haxball / haxball-issues

116 stars 44 forks source link

setPlayerDiscProperties or setDiscProperties - high CPU usage #1502

Open haxball-app opened 3 years ago

haxball-app commented 3 years ago

Heya, I was wondering if it is only me who has some problems with CPU utilization caused by those functions.

I.E. In tick event I have implemented code that is changing ball color if some conditions have been met and right in the moment that happens CPU usage is jumping from 5% to 70% of the puppeteer process.

I was monitoring behaviour while using methods like getDiscProperties/getPlayerDiscProperties/getBallPosition/getPlayerList in tick event and all of those did not cause such high CPU usage.

Any ideas how to make it more lightweight?

AmberJC commented 2 years ago

I can confirm that we too have had similar problems causing a lag spike from 30 to 800 for each single user by changing different physics of the game such as the player's speed and other factors that with other vps caused the same but in small spikes