0.10.0 • Published 2 years ago

@box2d/benchmark v0.10.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@box2d/benchmark

A benchmark to compare various js/ts Box2D implementations.

Try it here: https://lusito.github.io/box2d.ts/

Fair Warning: In theory this can be added as a dependency to other physics libraries in order to run benchmarks against local code. But this has not been tested yet.

Based on bench2d by joelgwebber

Example output using node.js v12.16.3

Nameavg ms/frame5th %ile95th %ileRatio
box2d.js2.75241.00
box2d-web4.68461.71
@box2d/core9.231093.36
box2d-html511.5910134.22
@flyover/box2d18.3316216.68
planck.js23.3919288.52

Example output using Firefox 81

Nameavg ms/frame5th %ile95th %ileRatio
box2d-web13.701081.00
@box2d/core15.1016121.10
box2d-html519.1216401.40
box2d.js23.0837201.69
@flyover/box2d25.8938231.89
planck.js111.9064408.17

Example output using Chrome 86

Nameavg ms/frame5th %ile95th %ileRatio
box2d.js5.47661.00
box2d-web6.96661.27
@box2d/core10.051071.84
box2d-html511.0511102.02
@flyover/box2d17.8320173.26
planck.js23.1725184.23

The @box2d Ecosystem

@box2d is a full-blown ecosystem for box2d for the JavaScript/TypeScript world. It can be used both in the browser and in node.js

Check out demos and compare performance here: https://lusito.github.io/box2d.ts/

Fair Warning: The whole @box2d ecosystem is in an early stage, so it will probably change a lot before we release the first stable version (1.0.0).

Other packages included in the ecosystem:

  • Benchmark: Based on bench2d by joelgwebber
  • Controllers: From the LiquidFun project
  • Particles: Also from the LiquidFun project
  • Lights: ported from LibGDX
  • DebugDraw: Debug drawing using a canvas
  • Testbed: A set of demos, partially ports of the original projects, partially new ones.

Contributing

We're looking for contributors to make this the best place to start with box2d on the web. Check out the project page for more information: https://github.com/Lusito/box2d.ts