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

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
daviel
Prole
Posts: 7
Joined: Tue Apr 17, 2018 5:10 pm

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

Post by daviel » Tue Apr 17, 2018 5:16 pm

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.

User avatar
ivan
Party member
Posts: 1304
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post by ivan » Tue Apr 17, 2018 7:35 pm

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()

daviel
Prole
Posts: 7
Joined: Tue Apr 17, 2018 5:10 pm

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

Post by daviel » Wed Apr 18, 2018 9:02 am

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.

daviel
Prole
Posts: 7
Joined: Tue Apr 17, 2018 5:10 pm

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

Post by daviel » Sun Apr 29, 2018 4:57 pm

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.

User avatar
ivan
Party member
Posts: 1304
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

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

Post by ivan » Sun Apr 29, 2018 5:05 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests