planck.js icon indicating copy to clipboard operation
planck.js copied to clipboard

I've updated my benchmark for 3 active js Physics Engines.

Open finscn opened this issue 3 years ago • 5 comments

I've updated my benchmark for 3 active js Physics Engines. This benchmark is very very simple and basic . But I think it has already could tell us something .

https://finscn.github.io/phy-benchmark/

Bad news , planck.js is the slowest one

finscn avatar Nov 04 '21 07:11 finscn

Thank you very much for reporting!

I will try to find and remove deoptimizations as soon as I find some time

zOadT avatar Nov 04 '21 17:11 zOadT

Asus K53SV; 8 GB RAM, i3 2.2 GHertz (2 cores); Intel HD Graphics 3000; Nvidia Geforce GT 540M (1 GB); Windows 10

  • box2d.ts : 27 FPS image

  • planck.js : 17 FPS image

  • matter.js : 43 FPS image

8Observer8 avatar Nov 24 '21 17:11 8Observer8

matter.js isn't really comparable, even though it is faster the quality of its physics simulation is much worse.

quinton-ashley avatar May 20 '22 23:05 quinton-ashley

I found another benchmark here: https://lusito.github.io/box2d.ts/benchmark/

I tested with laptop ASUS K53SV:

Browser: Chrome 104

Name avg ms/frame 5th %ile 95th %ile Ratio
box2d.js 7.53 8.099999904632568 13.600000143051147 1.00
box2d-web 14.19 15.5 12.599999904632568 1.89
@box2d/core 20.95 21.299999952316284 16.799999952316284 2.78
box2d-html5 27.44 28.200000047683716 26.399999856948853 3.65
@flyover/box2d 39.47 41.799999952316284 38 5.24
planck.js 56.85 61 44.799999952316284 7.55

8Observer8 avatar Aug 28 '22 08:08 8Observer8

Stats on my MacBook Air 2020 (M1 chip)

Browser: Chrome 104

Name avg ms/frame 5th %ile 95th %ile Ratio
box2d.js 5.43 6 6.099999999627471 1.00
box2d-web 5.87 5.599999999627471 6.1000000005587935 1.08
@box2d/core 6.35 6.099999999627471 7.2000000001862645 1.17
box2d-html5 7.07 7.3999999994412065 7 1.30
@flyover/box2d 10.50 11.199999999254942 10.200000000186265 1.93
planck.js 13.04 26.09999999962747 10.5 2.40

Browser: Firefox 104

Name avg ms/frame 5th %ile 95th %ile Ratio
box2d.js 5.15 6 5 1.00
box2d-web 7.12 7 6 1.38
@box2d/core 10.41 11 7 2.02
box2d-html5 10.73 12 9 2.08
planck.js 20.66 22 24 4.01
@flyover/box2d 23.38 31 23 4.54

quinton-ashley avatar Sep 01 '22 17:09 quinton-ashley