Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.05 KB

File metadata and controls

42 lines (29 loc) · 1.05 KB

Benchmark

This benchmark compares the historical Rust solver from commit da725dba93f61099d264bc597d22ff388d09d2ad against the current C solver at HEAD.

What it does

  • Rebuilds the Rust implementation from benchmark/rust
  • Rebuilds the current C implementation from src/c
  • Loads both Node targets
  • Verifies the same challenge cases before timing them
  • Reports average time per solve and the relative speedup

Run it

bun --cwd benchmark run bench

Optional environment variables:

  • BENCH_ITERATIONS controls the timed loops, default 10
  • BENCH_WARMUP controls warmup rounds, default 2

Browser version

This repo also includes a browser-hosted version that loads the wasm modules in a real browser context.

bun --cwd benchmark run bench:browser

Then open the printed local URL. You can override the browser benchmark loop counts with query parameters like ?iterations=20&warmup=3.

Requirements

  • make
  • clang
  • git
  • rustup
  • the wasm32-unknown-unknown target installed for the rustup-managed toolchain