Sprite blitting performance.

Hello,
I have a small program that displays sprites in order to know the performance of the plot, and it’s quite surprising because the speed is more or less the same whether I display sprites of 32x32 pixels, sprites of 128x128 pixels or 512x512 pixel sprites.

The speed is still around 2000 sprites at 60 fps!

I have the idea that solar2D does a lot of obscure stuff that ends up simply limiting the speed of the plotting.

Say otherwise the bottleneck is not in the graphics card but in the engine of Solar2D.

But what exactly does Solar2D do ???

I’m not exactly sure as to what you mean.

If you are testing on a computer with a dedicated GPU, then you are very unlikely to hit any GPU related bottlenecks. Also, if you are creating sprites out of only a few images, then the first time that Solar2D uses the textures, it caches them. Even if you were to create 2000 display objects using the same texture, the texture memory usage won’t go up, but Lua and C memory usage will go up.

While loading a smaller texture may be relatively a lot faster than loading a larger one, the absolute difference may be so negligible when you aren’t loading hundreds or thousands of textures it just doesn’t register.

Since your topic title says “Sprite blitting performance” I’m assuming this has to do with rendering…

Are you expecting a higher FPS? Solar2D is capped at 60.

As to the obscure stuff it does, on the better side it can do draw calls / batching:

Other insights mentioned here as well:

Sorry for my late reply

When I started to use Solar2D, I’ve made a little bench, you can find the code here :

Framerate Benchmark

once you have tested the code, try to use a smaller or a bigger sprite (32x32 pixels or 512x512 pixels), and you should be surprised to see the performance don’t really change !

That probably mean (for me) that the sprite display time is small compared to what Solar2D does before displaying it!

I have tested another game engine using Lua and the result is not the same at all : big sprite are really slower than small ones !

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.