Replies: 2 comments 17 replies
-
(I've moved this to the discussion forum. If I found an actionable item, I'll create a new issue) Apparently atlas.DrawTriangles creates many objects, but I was wondering if there are other objects in your program. |
Beta Was this translation helpful? Give feedback.
15 replies
This comment has been hidden.
This comment has been hidden.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Ebitengine Version
2.7.4
Operating System
Go Version (
go version
)1.22.1
What steps will reproduce the problem?
I wrote a small game of life clone using Ebitengine. It works nicely so far. But when I increase the number of cells above some certain amount, then CPU performance detoriates dramatically. FPS goes down to <5. If I enable CPU profiling on the game, the whole system freezes and needs a hard reset.
What is the expected result?
No issue with high cell (that is: image) counts.
What happens instead?
FPS goes down rapidly and the game becomes unresponsive.
Anything else you feel useful to add?
The source of the game in question is here: golsky. I was unable to actually get a non-zero profiling file using the ebitengine main loop. Therefore I created a fake main loop. Profiling can be initiated with these options:
This is an example call which causes the FPS problem:
My first thought was that my own code is the culprit, of course. But when I looked into the profiling results, it looked different:
So, in the game I pre-compute the tile images and in
game.Draw()
I just put these images onto the screen image.Ok, I'm still new to game development (and even golang for that matter), so I'm pretty sure there might be lots of things I could improve in my code. But
pprof
says something different.Beta Was this translation helpful? Give feedback.
All reactions