keep in mind that html5 is still in beta and barely 4 months old
Some really cool stuff. I built an apk using the latest public release of Corona and @roaminggamer’s optimized version of bunnymark, it got 18-23 fps at 1000 bunnies. I rebuilt the Defold version of the benchmark using their latest version as well to see if anything had changed and for consistency, tested on the same phone right after roaminggamer’s version of bunnymark I still get 12k bunnies at 31 fps using their recommended method of go.animate(), particlesfx could hit up to 15k but wouldnt be a very real approach to drawing sprites. This was tested on my LG V20.
Some side observations, building the android apk was pretty hassle free like it is for defold, I had issues getting gideros to build me one some time ago, and my other observsation is apk size, I believe gideros had the largest one but I forget how big, defold’s bunnymark which comes with the options to choose from 5 different methods of drawing bunnies was only 2.88mb, corona was in the middle at 6.86mb. However from what I understand Corona has a lot more higher level constructs and such, meanwhile defold works a little closer to the metal with less overhead so I think this was to be expected. Benchmarks only tell one side of a story, so there is no better engine here, just engines that are better at different things.
Still this seems a little slow, I think there could be some possible tweaks made to get more bunnies out of corona.
image sheet/sprite might help… test appears to be a batching nightmare
Yeah, batching is for sure the most required optimization here and I’m sure Defold does using a texture atlas, so at the moment the comparison is not remotely fair.
I’ll give this a try later today and try some additional optimizations, but there’s only so much you can do with such simple code. With regards to the general code of Defold I’d say they’re in general not at a lower level as Corona and the update code for the bunnies isn’t even that optimized (could use an additional local here or there) but then, it might just not have an impact in such a small piece of code calling into engine APIs that many times.
The probably biggest Defold performance advantage is it’s usage of LuaJIT - it’s just a so much faster VM even with a disabled jit compiler (as that’s not allowed on iOS and does have some issues wrt the memory manager on Android).
Defold does indeed use atlases to cut down on size and better performance. It also does most of the work for you in regards to batching. Does Corona not use LuaJIT? It does offer a huge performance advantage over just regular 5.x Lua.
Corona does not use LuaJIT at the moment - also even though it is an exceptional piece of software (even more so given it’s kind of the work of a single dev) but I can also understand that it’s not the simplest decision as it’s kind of stuck around Lua 5.1 (+ some features of 5.2).
But then Corona does not use a newer version of Lua anyway *and* it seems that more recent Lua versions are still slower (there was some discussion over at the Lua mailinglist) than 5.1 anyway so, besides native integer support and bitops there’s not that much to be gained from newer versions IMO.
You can and should add your vote for a feature you like to see implemetned (or even request new ones) for Corona at the feedback site.
re lua: just benchmark it, fe replace newImage() with {x=123,y=0}. my guess would be ~100X performance, if so then lua isn’t the limiting factor, move on.
iPhone 5c (2013 released) : 25 fps
Samsung Galaxy A7 (2016 released) : 3 fps
lol
p.s: A7 is the better hardware specification.
Without any details, there’s now way to guess what’s going wrong.