Hey,
A puzzling bug (at least to me) ??? - previously my game was running at 60 FPS no problem, but one day when I ran it again, the framerate was down to 3-4 FPS. I found that I could restore the full framerate by removing some graphics2D.drawString() calls.
But then the next day, it seemed to be back down to 3-4 FPS (I had made some minor code changes in the interim). When I removed all but 1 of the drawString calls, the framerate went back to 60FPS again. But the amount of text I’m now able to draw without a very drastic slowdown is far less that what I could draw originally…
Perhaps the drawStrings are not the issue and there is some other drawing operation that I am compensating for by removing them. I’m clutching at straws here… Has anyone experienced anything similar who could give me some suggestions what might be going on? Is there some limit to Graphics2D calls that might be causing the slow-down?
Thanks.
Edit: Latest news - as far as I can tell it’s a fairly generalised slow-down from the old to the new version. Profiling identical code in the 2 versions gives a performance drop of 10-20x. This is not some big complicated game, just a single class that I’m coding for the 4K compo. My latest guess is that it’s something memory-related, but I am trying some more advanced profiling to see what might be going on…