Bunnymark benchmark

I was browsing and I came across this benchmark https://github.com/eray-z/Game-Engine-Benchmarks

I got curious considering the results so I did a quick port to Defold https://github.com/Infuscy/Defold-Bunnymark

I didn’t get the chance to run the benchmark as I don’t have that phone and I was short on time but if anyone is curious and has some free time, I would love to have them test and share with us the results.

Enjoy and defold away.

/Fuscy

1 Like

Tested on iPhone 5. Seems to do great up to 400 then begins to slow down.












1 Like

Sweet! Thanks @Pkeod.

I wonder what the profiler would show to be taking the longest and if there is anything we could do to optimize.

This was run with a release build?

/Fuscy

Not release - debug. I’ll check profiler soon.

1 Like

The results should be better in release… I think.

Probably would at least double before losing FPS. I can test that later.

Did some research and changed the way the for loop works. In theory it should be 50% faster.

There are actually quite a few performance improvements you can make. I created my own version: https://github.com/britzl/defold-bunnymark

A couple of key things to consider in your version:

  • Don’t do go.get_position(). Keep one vector3 per bunny and work against that vector3 in update().
  • And if you insist on doing go.get_position, then consider using that vector3 instead of creating a new vector3 for every bunny every frame.
  • Avoid index access into tables (every foo.something requires a lookup of something against the foo table)
  • You should store go.set_position in a local variable
  • You should store self.minY, self.maxY, self.minX and self.maxX in local variables outside the loop
2 Likes

Sweet performance tips @britzl

Did some testing on my Samsung T230.

Used the Unity bunnymark also and got stable 60 at 200 bunnies, at 300 it was about 50-55 and at 400 it was <50.
Defold seems to go up to 500 stable.

This is using my script with some of the changes you’ve suggested:

This is using your example. Very strange case here. There’s something hogging the fps but I don’t know what:

And this is on an i7-6700K / GTX 970:

Got stable 60fps with 1600 bunnies (bouncing animated, but without rotation) on Samsung GS2Plus (800*480pix)

1 Like

go.animate is much more efficient than set_position but I think it also uses a different mechanism.

go.animate is at least 3x more efficient, but probably a lot more than that. If you compare this bunnymark: https://github.com/britzl/defold-bunnymark/blob/master/bunnymark/go_animate/go_update.script you will be able to reach the current instance cap of around 32k game objects while retaining 60fps on a desktop machine. On the same machine I was able to reach around 9k game objects with the bunny mark I posted earlier in this thread.

3 Likes

Are you using Defold 1.2.82 or something above that in the alpha channel? Sprite performance (and overall performance) got some massive optimizations in the most recent update.

I think the desktop machine result was not seen properly :wink:

I tested using 1.2.82 and the sprite is the same as the bunnymark found on the webs. After doing the changes that @britzl suggested, I got up to to 11000 GameObjects @60fps getting moved procedurally which in my opinion is pretty good.

Even for mobile, my benchmark showed that at 500 GO (on my crappy tablet) Defold was running smooth. I doubt that I’ll ever need to use so many GO.

What I was curious about is that @britzl example was starting at 44 fps with 100 objects on my tablet and I can’t explain why.

Interesting. I’d also like to know why. If I get the time I’ll try this on a couple of devices/tablets as well.