Environment:
using DisplayLink director
iPod Touch 4th gen / iPad 1st gen
firmware: iOS 5.0.1 / iOS 4.3.5
cocos2d for iPhone v2.0.0-rc1
cocos2d compiled in Release mode, using unroll loops optimization
Xcode 4.3.2
Compiler: Apple LLVM 3.1
FPS:
A particle size = 4 pixels
B particle size = 8 pixels
C particle size = 32 pixels
D particle size = 64 pixels
PointParticleSystem using a 32-bit texture (
PNG)
PointParticleSystem using a 16-bit texture (
PNG)
PointParticleSystem using a 8-bit texture (
PNG)
PointParticleSystem using a 4-bit texture (PVRTC)
QuadParticle System using a 32-bit texture (
PNG)
QuadParticle System using a 16-bit texture (
PNG)
QuadParticle System using a 8-bit texture (
PNG)
QuadParticle System using a 4-bit texture (PVRTC)
| 4000 particles |
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| A | N/A | N/A | N/A | N/A | 60 | 60 | 60 | 60 |
| B | N/A | N/A | N/A | N/A | 60 | 60 | 60 | 60 |
| C | N/A | N/A | N/A | N/A | ~25 | ~25 | ~18 | ~25 |
| D | N/A | N/A | N/A | N/A | ~8 | ~8 | ~6 | ~8 |
ParticleTest seems to be up ~15% slower than v1.0.0.
A set randomly the position of the sprites. All the positions are inside of the screen
B set randomly the position / scale of the sprites. All the positions are inside of the screen
C set randomly the position / scale / rotation of the sprites. All the positions are inside of the screen
D All sprites are rendered outside the screen
E 80% of the sprites are positioned outside the screen. The other 20% is inside the screen
F Perform transform Scale and Rotate actions to all sprites. 100% of the sprites inside the screen
G Perform transform Scale and Rotate actions to all sprites. 20% of the sprites inside the screen
1 sprite of 52×139 pixels. 32-bit texture
1 batched sprite of 52×139 pixels. 32-bit texture
1 batched sprite of 52×139 pixels. 16-bit texture
1 batched sprite of 52×139 pixels. 4-bit texture
14 sprites of 85 x 121 each. 32-bit texture
14 batched sprites of 85 x 121 each. 32-bit texture
14 batched sprites of 85 x 121 each. 16-bit texture
14 batched sprites of 85×121 each. 4-bit texture
64 sprites of 32×32 each . 32-bit Texture
64 batched sprites of 32×32 each. 32-bit Texture
64 batched sprites of 32×32 each. 16-bit Texture
64 batched sprites of 32×32 each. 4-bit texture
| 250 sprites |
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| A | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 |
| B | 60 | 60 | 60 | 60 | ~55 | ~55 | 60 | 60 | 60 | 60 | 60 | 60 |
| C | 60 | 60 | 60 | 60 | ~50 | ~50 | 60 | 60 | 60 | 60 | 60 | 60 |
| D | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 |
| E | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 |
| F | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 |
| G | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 | 60 |
| 2000 sprites |
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| A | ~8 | ~8 | ~8 | ~8 | ~7 | ~7 | ~7 | ~7 | ~15 | 60 | ~50 | 60 |
| B | ~8 | ~8 | ~8 | ~8 | ~6 | ~6 | ~6 | ~6 | ~15 | ~45 | ~45 | ~45 |
| C | ~8 | ~8 | ~8 | ~8 | ~6 | ~6 | ~6 | ~6 | ~15 | 45 | ~45 | ~45 |
| D | ~30 | 60 | 60 | 60 | ~20 | 60 | 60 | 60 | ~20 | 60 | 60 | 60 |
| E | ~22 | ~50 | ~51 | ~51 | ~17 | ~40 | ~40 | ~40 | ~17 | 60 | 60 | 60 |
| F | ~14 | ~15 | ~15 | ~17 | ~8 | ~10 | ~12 | ~13 | ~13 | ~51 | ~55 | ~55 |
| G | ~14 | ~55 | ~55 | ~55 | 12 | ~40 | ~50 | ~51 | ~13 | ~51 | ~55 | ~55 |
Sprite seems to pretty similar to v1.0.0. There are some exceptions where the performance could is a bit faster (2 or 3%), and other exceptions where the performances is slower (up to 10% slower)
Environment:
ms: milliseconds, the lower the better.
Tests:
Test A: Iterate array of sprites using the Fast Enumeration
API
Test B: Iterate array of sprites using the C
API
Test C: Add %10 of the sprites in the spritesheet with different Z order
Test D: Remove %10 of the sprites from the spritesheet with different Z order
Test E: Reorder %10 in a spritesheet
| 1500 sprites |
| A | ~0.8 |
| B | ~0.7 |
| C | ~32 |
| D | ~59 - ~76 |
| E | ~12 |
| 2500 sprites |
| A | ~1.4 |
| B | ~1.3 |
| C | ~100 |
| D | ~190 - ~220 |
| E | ~12 |
These tests weren't performed in v2.0.0 It is believed that they perform as fast as in v1.0.0
How many bytes it takes to create an empty instance, without the possible inner mallocs.
| Class | bytes |
| CCNode | 176 |
| CCLayer | 176 |
| CCScene | 176 |
| CCSprite | 368 |
| CCSpriteBatchNode | 192 |
| CCTexture2D | 48 |
| CCLabelTTF | 400 |
cocos2d v2.0 takes less memory to create objects than v1.0