Bunnymark benchmark

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
3 Likes