← Back to Home

Performance Benchmarks

Run real-time physics benchmarks in your browser. Compare nape-js against Matter.js, Planck.js, and Rapier (WASM) on identical scenarios. All tests run client-side — results reflect your hardware.

Engines

Scenario

Beyond Raw Speed — Feature Comparison

Performance is only one dimension. Here is what each engine supports:

Feature nape-js Matter.js Planck.js Rapier
CCD (tunneling prevention)
Fluid simulation (buoyancy) Unique
Full TypeScript (strict) DT JS WASM
Serialization (JSON+Binary) Binary
Capsule shape (native)
Sub-stepping solver
Bundle size ~87 KB (16 KB gz) ~82 KB ~290 KB ~1.6 MB (WASM)
Zero dependencies WASM
Methodology: Each scenario creates identical physics scenes across all engines. After a warmup phase, step(1/60) is called repeatedly and timed with performance.now(). Results show the median step time (ms) to eliminate GC spikes. Lower is better.

Rapier note: Rapier runs via WASM+SIMD and is not a pure JavaScript engine. Its performance reflects the advantage of compiled code — a fundamentally different approach from the other three engines.

Fairness: All engines use their own default solver settings (nape-js: 10 vel / 10 pos iterations; Planck.js: 8/3; Matter.js: 6/4; Rapier: 4/1). Gravity is normalized to equivalent pixel-space acceleration (600 px/s²) across all engines. Body counts, sizes, and positions are identical. A deterministic pseudo-random seed ensures reproducible layouts. Run benchmarks multiple times for stable results.