npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@box2d/benchmark

v0.10.0

Published

A benchmark to compare various js/ts Box2D implementations

Downloads

21

Readme

@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

| Name | avg ms/frame | 5th %ile | 95th %ile | Ratio | | -------------- | ------------ | -------- | --------- | ----- | | box2d.js | 2.75 | 2 | 4 | 1.00 | | box2d-web | 4.68 | 4 | 6 | 1.71 | | @box2d/core | 9.23 | 10 | 9 | 3.36 | | box2d-html5 | 11.59 | 10 | 13 | 4.22 | | @flyover/box2d | 18.33 | 16 | 21 | 6.68 | | planck.js | 23.39 | 19 | 28 | 8.52 |

Example output using Firefox 81

| Name | avg ms/frame | 5th %ile | 95th %ile | Ratio | | -------------- | ------------ | -------- | --------- | ----- | | box2d-web | 13.70 | 10 | 8 | 1.00 | | @box2d/core | 15.10 | 16 | 12 | 1.10 | | box2d-html5 | 19.12 | 16 | 40 | 1.40 | | box2d.js | 23.08 | 37 | 20 | 1.69 | | @flyover/box2d | 25.89 | 38 | 23 | 1.89 | | planck.js | 111.90 | 64 | 40 | 8.17 |

Example output using Chrome 86

| Name | avg ms/frame | 5th %ile | 95th %ile | Ratio | | -------------- | ------------ | -------- | --------- | ----- | | box2d.js | 5.47 | 6 | 6 | 1.00 | | box2d-web | 6.96 | 6 | 6 | 1.27 | | @box2d/core | 10.05 | 10 | 7 | 1.84 | | box2d-html5 | 11.05 | 11 | 10 | 2.02 | | @flyover/box2d | 17.83 | 20 | 17 | 3.26 | | planck.js | 23.17 | 25 | 18 | 4.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