workadventure / workadventure

A collaborative web application (virtual office) presented as a 16-bit RPG video game
https://workadventu.re
4.19k stars 622 forks source link

char editor lags #1165

Open LuckyTurtleDev opened 3 years ago

LuckyTurtleDev commented 3 years ago

After some time the char editors start to lag extreme. It took about 5 seconds delay and the frame rate drops below 0.5fps. Sometime Firefox say that this page slow down the browser. This does happen with the official demo instance and my self hosted workadventure on Firefox.

https://user-images.githubusercontent.com/44570204/121777082-90ccc480-cb90-11eb-8ae5-edbcb3a8c597.mp4

https://user-images.githubusercontent.com/44570204/121777208-341dd980-cb91-11eb-92f8-e7b0a2d3113c.mp4

moufmouf commented 3 years ago

Weird, I can confirm, and reproduce on Chrome.

Here is a performance record in Chrome:

image

The function that takes time is in Phaser. It is Phaser.Structs.ProcessQueue#update I'm not sure why yet.

LuckyTurtleDev commented 3 years ago

While I did search for a map I did found a older workadventure instance, where it does not happen. The gui was also a lite different and I needed to press enter to start. Sadly I was not able to find it again. But it seems to be a problem only for the newer workadventure versions.

moufmouf commented 3 years ago

I'm pretty sure we add some version of this problem in earlier release (before the redesign at least). It seems to be a Phaser bug where the update list keeps growing sometimes, for some reason, even if we try to delete some sprites.

moufmouf commented 3 years ago

1176 only partially fixes the issue

jonnytest1 commented 3 years ago

I'm pretty sure we add some version of this problem in earlier release (before the redesign at least). It seems to be a Phaser bug where the update list keeps growing sometimes, for some reason, even if we try to delete some sprites.

is it even necessary to delete things ? it seems cleaner to just move them probably with sprite.setX