So I took the latest official version of zoetrope (0.8.0) and another version with 0.9.0 patches, and used its sprite and collision benchmarks. The sprite ones could go on forever, so I set a time limit of one minute. At the end of that time, I would write down the number of sprites it could put on screen maintaining 60 fps.
0.8.0:
sprites: 891
simple collision: 534
displacing collision: 498
0.9.0:
sprites: 2217
simple collision: 1020
diplacing collision: 1025
diplacing collision: 1010
Yeah, I ran the last test twice.
THAT'S REAL AWESOME, THANKS DEV TEAM!
0.8.0 vs 0.9.0 benchmark = yay!
Re: 0.8.0 vs 0.9.0 benchmark = yay!
This is a huge difference, that's amazing!
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: 0.8.0 vs 0.9.0 benchmark = yay!
Do the benchmarks use SpriteBatches? If not, they aren't really testing the right things (SpriteBatches are what you should use when you care about performance when drawing sprites.)
Also, I suspect you're testing the difference between calling C API functions in Lua versus LuaJIT more than anything else.
Also, I suspect you're testing the difference between calling C API functions in Lua versus LuaJIT more than anything else.
Re: 0.8.0 vs 0.9.0 benchmark = yay!
SpriteBatches should (or can?) only be used on static things right? Since they save a location, if that changes it wont work right?slime wrote:Do the benchmarks use SpriteBatches? If not, they aren't really testing the right things (SpriteBatches are what you should use when you care about performance when drawing sprites.)
Also, I suspect you're testing the difference between calling C API functions in Lua versus LuaJIT more than anything else.
So background stuff and other environmental things should be drawn with spriteBatches but moving things such as the player should be drawn normally. Or have I misunderstood?
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: 0.8.0 vs 0.9.0 benchmark = yay!
SpriteBatches can be used anywhere that you can draw more than one of the same image (or more than one quad using the same image). They also should be used in that situation, if performance is a concern.Jeeper wrote:SpriteBatches should (or can?) only be used on static things right? Since they save a location, if that changes it wont work right?
So background stuff and other environmental things should be drawn with spriteBatches but moving things such as the player should be drawn normally. Or have I misunderstood?
They'll almost always be faster than drawing images by themselves (even when clearing/re-adding to the SpriteBatch every frame) as long as you put more than one thing in the SpriteBatch, and use SpriteBatch:bind / SpriteBatch:unbind when adding or setting more than a dozen or so.
0.8.0's code has some inefficiencies in the SpriteBatch implementation compared to 0.9.0, but some of the above is still true for 0.8.0.
Any group of things which either have the same image or can be converted to use a texture atlas can use a single spritebatch which only needs to be modified when the properties (position, color) of the sprites change relative to other sprites in the same batch.
Last edited by slime on Fri Dec 27, 2013 8:03 pm, edited 1 time in total.
Re: 0.8.0 vs 0.9.0 benchmark = yay!
I wonder which is the right way to use a spritebatch for dynamically updating / moving sprites.
I Tried the follwing but it does not work as expected. ( see my next post for the files! )
Any help with that?
Examples moved to a later post !
I Tried the follwing but it does not work as expected. ( see my next post for the files! )
Any help with that?
Examples moved to a later post !
Last edited by MadByte on Wed Jun 25, 2014 12:05 pm, edited 2 times in total.
Re: 0.8.0 vs 0.9.0 benchmark = yay!
It seems like zoetrope doesn't use SpriteBatches. DOES THAT MEAN THAT PERFORMANCE IS EVEN MORE ÜBER AMAZING?!?!?!slime wrote:Do the benchmarks use SpriteBatches? If not, they aren't really testing the right things (SpriteBatches are what you should use when you care about performance when drawing sprites.)
Also, I suspect you're testing the difference between calling C API functions in Lua versus LuaJIT more than anything else.
Re: 0.8.0 vs 0.9.0 benchmark = yay!
I just tried some things out using spritebatches for updating stuff.
When I'm not using spritebatch:bind / unbind inside the update loop the performance is almost the same as when I'm updating stuff the regular way without batches, but still it is not as fast with batches as the same without batches. Sorry for being pesistent but I'm really interested in some anwsers for that kind of stuff. I'm obviously not that experienced with it, but if there is a chance to increase performance using spritebatches I want to know that.
Here is the example using a spritebatch ( without bind / unbind inside love.update ): And here is the example without a spritebatch : edit: sorry uploaded the "withbatch" version without the "bind / unbind" fix... I changed that now.
When I'm not using spritebatch:bind / unbind inside the update loop the performance is almost the same as when I'm updating stuff the regular way without batches, but still it is not as fast with batches as the same without batches. Sorry for being pesistent but I'm really interested in some anwsers for that kind of stuff. I'm obviously not that experienced with it, but if there is a chance to increase performance using spritebatches I want to know that.
Here is the example using a spritebatch ( without bind / unbind inside love.update ): And here is the example without a spritebatch : edit: sorry uploaded the "withbatch" version without the "bind / unbind" fix... I changed that now.
Re: 0.8.0 vs 0.9.0 benchmark = yay!
I remember that in the ATL examples you could alternate between with/without SpriteBatches. There was always a good difference in performance, but it varied. It was a great difference when the tiles didn't overlap, but not that much when in isometric. Maybe you can check that out, MadByte? (and share your findings, cause I got a bit curious too)
Re: 0.8.0 vs 0.9.0 benchmark = yay!
Cool, I didn't thought about that and you're right. When the entities does not overlap the spritebatch version is ~100FPS better for me then the version without spritebatch.
With: Without: But if this is the only advantage using a spritebatch I don't see how this can help in a game exept a tile based one.
Still I'm not completly sure if there isn't another (better) way to create the batch which give us a better performance.
With: Without: But if this is the only advantage using a spritebatch I don't see how this can help in a game exept a tile based one.
Still I'm not completly sure if there isn't another (better) way to create the batch which give us a better performance.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest