Page 1 of 1

ProFi is noticeably improving game performance

Posted: Wed Jan 15, 2020 10:27 pm
by EPriest
As sprites are added to the screen, as expected my game gets progressively slower, so I used ProFi, to find out what my bottleneck was.
https://gist.github.com/perky/2838755

As it turns out, the collision detection checks between my game objects are taking up the most time, while drawing the sprites, takes the next most at about 1/4 of the time as the collision detection.

The strange thing is that using ProFi has significantly sped up the execution of my code.

Using love.timer.getTime() values for comparison, the update and draw functions are taking up something like four times less time to run when ProFi is active. If I comment out ProFi:start(), the game goes right back to running slowly.

Does anyone have an idea about why ProFi is improving performance?

Re: ProFi is noticeably improving game performance

Posted: Thu Jan 16, 2020 9:32 pm
by SyntheticDreamCorp
It's impossible to really tell if you don't provide code where it happens and users here can poke and prod at it. You should either post your source, or recreate the effect in a simplified love project and post that (that's usually simplest)

My instinct with situations like this would be to investigate timer.getTime() and see if it's merely appearing to be faster, rather than actually being faster. If it really does seem like things are running faster, then I would probably try to investigate what internal changes happen when the debug hooks are used, and see if that could be causing the differences. Anything beyond that changes depending on how exactly your code is put together.

Re: ProFi is noticeably improving game performance

Posted: Fri Jan 17, 2020 4:02 am
by pgimeno
See also this other recent thread: https://love2d.org/forums/viewtopic.php?f=4&t=88029