Hello, I’m evaluating Phaser to build a simple puzzle game. I’ve found that CPU usage is very high (~100% of 1 core) even though there’s no changes in the game.
I’ve seen a Phaser 2 plugin for optimizing CPU that allows to render the game only when there are changes, but I can’t find anything similar for Phaser 3. I’m sure that there is some option somewhere to optimize that, but don’t know where.
Do you know if there is a way to optimize rendering for puzzle games?
You will have to post some of your code if you want the community to be able to help. Also, the example you linked is from Phaser 2, and runs fine on my computer (although I may be misunderstanding you.) Post your code in code tags which
It works fine but CPU usage spikes when I run the example, even when there is no movement. If I run it fullscreen, CPU usage increases even more.
I’ve tested it on Firefox 74.0 and Chromium 80.0.3987.87, both on Linux 64.
I’ve downloaded the example and launched it from localhost to check that the problem was not with the examples’ page. It has the same behaviour. I changed the example to run with only one card and it has the same CPU usage.
It’s like some kind of rendering loop is running despite there is no need to do it.
Thanks a lot, samme. I tried to adapt SaveCPU plugin from version 2 but I was unable to do so. I may make another attempt now that I have your plugin as an example. If I could have some time to be at home…
This was the CPU usage I had before using the plugin: