lucymhdavies / egg-game

Live. Bounce. Die. Repeat.
https://labs.lmhd.me/egg
3 stars 0 forks source link

TPS (and FPS) drops when stats window is visible #31

Closed lucymhdavies closed 5 years ago

lucymhdavies commented 5 years ago

Most noticeable on my iPad. I kinda just assumed this was my iPad being slow, and was a problem with the window being semi-transparent, but I do not get the same issue on the items window.

For comparison:

3FC48B55-546A-4BBA-8A37-12FF279CEBDB 78B41CE2-6F10-49C9-9F0F-BDFB6FE7802B 65A331BB-8F8B-475A-AF4F-E2D7AAF8B64E 124F480B-200B-4685-A8AA-36281AFD3437

lucymhdavies commented 5 years ago

It appears to be a Draw issue.

I’ve forced all Windows to return nil immediately in their Update function https://play.jsgo.io/07cf591cd77ea0c44a678274eb3ab48a2780bbe4

I’m still getting TPS and FPS drops when showing the stats window. I’m guessing this is the fault of the bar.

lucymhdavies commented 5 years ago

Yep. Definitely the bar.Draw. I’ve removed the bars, and the FPS is fine.

Makes sense. There’s a lot of heavy lifting in there, with it creating a new ebiten.Image for every bar every frame.