I promised a few benchmarks of ND2Dx and here they are. The flash movie and the complete source code can be found at the end of this article.
There are 4 benchmarks, comparing ND2Dx and Starling. Basically, I keep adding sprites, bitmaps or movieclips while the frame rate is equal or above 60 frames per second.
I’m using Hi-ReS-Stats for the frame rate monitoring. And as it calculates the frame rate every second or so, items might/will be added while the frame rate is actually lower than 60. So you might have a frame rate dropping straight to 52 for example. This is not an extremely precise benchmark but it still gives you a good overview of what ND2Dx is capable of (in terms of performance).
It is important to note that I’m using a specific batching technique (in ND2Dx) for this purpose.
Also, I know I announced more than 17000 sprites on a previous post but this was compiling the flash into an AIR app (more than 14000 is not too bad either)
Sprite2D vs. Bitmap
Very basic benchmark where items (sprites and bitmaps) rotates.
In ND2Dx, the pivot point of every textured node is centered by default, while in Starling, the pivot point is at 0,0 (top left corner) by default. This is why you will see a difference in how objects rotate in the flash movie below. This has no impact on performance.
ND2Dx Sprite2D: +-14500 sprites
Starling MovieClip: +- 5000 sprites
It is also important to note that I’m using the ENTER_FRAME event in Starling to rotate each bitmap based on the elapsed time between frames (“passedTime” var in Starling event). This is how it is said to be done, but there is a far better way (performance wise) to animate an object. The event dispatching is taking lots of resources but it seems to be the only way to access that “elapsed time” value that I think is very important when you want to make games. I quickly tested it without using the ENTER_FRAME event and it gave far better results for Starling (around 11.000 I think) but without the “elapsed time” feature. I didn’t have time to make a proper benchmark for that but you now know that it more than doubles the perfs of Starling…
Sprite2D with animated texture vs. MovieClip
Same same but different: the texture is “animated”.
ND2Dx Sprite2D with animated texture: +- 11500 sprites
Starling MovieClip: +- 3300 sprites
Test it yourself
And don’t hesitate to post your results in the comments.
And the complete source code as usual:
ND2Dx Benchmark source code