Using the new sprite-based performance test at GitHub - Shirajuki/js-game-rendering-benchmark: Performance comparison of Javascript rendering/game engines: Three.js, Pixi.js, Phaser, Babylon.js, Two.js, Hilo, melonJS, Kaboom, Kontra, Canvas API and DOM!, I spent some time comparing the latest 14.5 version of melonJS with the previous one to understand how much improvements we managed to pack into that version.
Globally the 14.5 version brings an average 20% performance improvements for both Sprite and Primitive rendering (running on a M1 Max laptop), bringing melonJS on par (at 60fps while drawing 10’000 sprites, knowing we are capped at 60fps) with other framework like Phaser or Pixi for sprite rendering.
For primitive drawing, especially with circles, we are still “a bit” behind when drawing more than 500 circles per frame, but that should be fixed with this ticket : fix batch drawing for primitive shapes · Issue #1172 · melonjs/melonJS · GitHub
14.4.0 | 14.5.0 | ||
---|---|---|---|
Stroke | 500 op/s | 60 fps | 60 fps |
1000 op/s | 60 fps | 60 fps | |
2500 op/s | 31 fps | 48 fps | |
5000 op/s | 14 fps | 22 fps | |
10000 op/s | 8 fps | 10 fps | |
Fill | 500 op/s | 45 fps | 60 fps |
1000 op/s | 21 fps | 30 fps | |
2500 op/s | 9 fps | 12 fps | |
5000 op/s | 4 fps | 6 fps | |
10000 op/s | 3 fps | 4 fps | |
Sprite | 500 op/s | 60 fps | 60 fps |
1000 op/s | 60 fps | 60 fps | |
2500 op/s | 60 fps | 60 fps | |
5000 op/s | 60 fps | 60 fps | |
10000 op/s | 50 fps | 60 fps | |
Perf Inc | |||
Stroke | 10000 op/s | n/a | 25% |
Fill | 10000 op/s | n/a | 25% |
Sprite | 10000 op/s | n/a | 17% |
(Note: at the time of this writing, the online version used by the benchmarking tool has not been updated yet with melonJS 14.5).
I’ll keep this topic pinned as a place to keep track of progress and improvements in terms of performances.