Page 1 of 1

I made some Love2D benchmarks for testing its pure performance. Feedback and thoughts are appreciated!

Posted: Tue Apr 17, 2018 5:16 pm
by daviel
https://github.com/daviel/Love2D-Benchmarks

This are a few benchmarks for testing the pure performance of Love2D. I implemented a naive approach first and then tried to optimize it. I also tested the new Love 11.1 versus the older version of 0.10.2.

Re: I made some Love2D benchmarks for testing its pure performance. Feedback and thoughts are appreciated!

Posted: Tue Apr 17, 2018 7:35 pm
by ivan
Looks OK, although FPS is not a specific measure of performance. For example if you want to test the physics system you should do it without any rendering since that could be a bottleneck.

Code: Select all

  for x=0, objectCount do
      objectsBatch:set(objects[x].id, objects[x].body:getX(), objects[x].body:getY(), objects[x].body:getAngle() )
  end
Could become:

Code: Select all

  for i=0, objectCount do
      local object = objects[i]
      local body = object.body -- faster using locals
      local x,y = body:getPosition() -- reduces the number of getX/getY function calls
      local a = body:getAngle()
      objectsBatch:set(object.id, x, y, a)
  end
Would be even faster if we had body:getTransform()

Re: I made some Love2D benchmarks for testing its pure performance. Feedback and thoughts are appreciated!

Posted: Wed Apr 18, 2018 9:02 am
by daviel
You're right FPS is bad for comparability. But it can give hints for pure performance measurement. I used a mixture of rendering and physics as it would be more alike to "real" games.

I will implement your suggestions and rerun the tests.

Re: I made some Love2D benchmarks for testing its pure performance. Feedback and thoughts are appreciated!

Posted: Sun Apr 29, 2018 4:57 pm
by daviel
I added your suggestions and even made a pull request for a body:getTransform() method https://bitbucket.org/rude/love/pull-re ... ethod/diff.
With this changes we win like 5% in speed.

Re: I made some Love2D benchmarks for testing its pure performance. Feedback and thoughts are appreciated!

Posted: Sun Apr 29, 2018 5:05 pm
by ivan
daviel wrote: Sun Apr 29, 2018 4:57 pm I added your suggestions and even made a pull request for a body:getTransform() method
Cool, I complained about getTransform before on the issue tracker (along with several other suggestions). Would be great if it's included in the future.