## 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.
daviel
Prole
Posts: 2
Joined: Tue Apr 17, 2018 5:10 pm

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

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.

ivan
Party member
Posts: 1225
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!

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: 2
Joined: Tue Apr 17, 2018 5:10 pm

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

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.

### Who is online

Users browsing this forum: No registered users and 7 guests