Skip to content

Benchmarks

Celox includes benchmark suites for the Rust core, the TypeScript runtime, and Verilator as a reference baseline. CI runs benchmarks on every push to master and publishes an interactive trend dashboard.

Dashboard

You can also view the raw data on the external dashboard.

What is Measured

Counter (N=1000)

The main workload uses a counter module (Top) with N=1000 parallel 32-bit counter instances. This exercises the full JIT pipeline under a realistic workload. Rust, TypeScript, and Verilator all benchmark the same design for direct comparison.

BenchmarkRustTSVerilator
simulation_build_top_n1000JIT compileNAPI buildVerilate + C++ compile
simulation_tick_top_n1000_x1Single tickSingle tickSingle tick
simulation_tick_top_n1000_x10000001M ticks1M ticks1M ticks
testbench_tick_top_n1000_x1Tick + readTick + readTick + read
testbench_tick_top_n1000_x10000001M testbench cycles1M testbench cycles1M testbench cycles
testbench_array_tick_top_n1000_x1Array .at() single
testbench_array_tick_top_n1000_x1000000Array .at() 1M

Standard Library Modules

Benchmarks for Veryl stdlib modules across all three runtimes.

Linear SEC (P=6) — Hamming single-error-correcting encoder/decoder (57-bit data, 63-bit codeword). Combinational.

BenchmarkRustTSVerilator
simulation_build_linear_sec_p6JIT compileNAPI buildVerilate + C++ compile
simulation_eval_linear_sec_p6_x1Single evalSingle evalSingle eval
simulation_eval_linear_sec_p6_x10000001M evals1M evals1M evals
testbench_eval_linear_sec_p6_x10000001M evals + read corrected1M evals + read corrected1M evals + read corrected

Countones (W=64) — Recursive combinational popcount tree.

BenchmarkRustTSVerilator
simulation_build_countones_w64JIT compileNAPI buildVerilate + C++ compile
simulation_eval_countones_w64_x1Single evalSingle evalSingle eval
simulation_eval_countones_w64_x10000001M evals1M evals1M evals

std::counter (WIDTH=32) — Multi-mode up/down counter with wrap-around.

BenchmarkRustTSVerilator
simulation_build_std_counter_w32JIT compileNAPI buildVerilate + C++ compile
simulation_tick_std_counter_w32_x1Single tickSingle tickSingle tick
simulation_tick_std_counter_w32_x10000001M ticks1M ticks1M ticks
testbench_tick_std_counter_w32_x10000001M tick + read1M tick + read1M tick + read

std::gray_counter (WIDTH=32) — Gray-encoded counter (counter + gray_encoder).

BenchmarkRustTSVerilator
simulation_build_gray_counter_w32JIT compileNAPI buildVerilate + C++ compile
simulation_tick_gray_counter_w32_x1Single tickSingle tickSingle tick
simulation_tick_gray_counter_w32_x10000001M ticks1M ticks1M ticks
testbench_tick_gray_counter_w32_x10000001M tick + read1M tick + read1M tick + read

std::fifo (WIDTH=8, DEPTH=16) — Synchronous FIFO with controller and RAM. Sequential.

BenchmarkRustVerilator
simulation_build_fifo_w8_d16JIT compileVerilate + C++ compile
simulation_tick_fifo_w8_d16_x1Single tick (push/pop alternating)Single tick (push/pop alternating)
testbench_tick_fifo_w8_d16_x10000001M tick + read1M tick + read

std::gray_encoder + gray_decoder (WIDTH=32) — Gray encode/decode roundtrip. Combinational.

BenchmarkRustVerilator
simulation_build_gray_codec_w32JIT compileVerilate + C++ compile
simulation_eval_gray_codec_w32_x1Single evalSingle eval
simulation_eval_gray_codec_w32_x10000001M evals1M evals

std::edge_detector (WIDTH=32) — Per-bit edge detection (posedge/negedge). Sequential.

BenchmarkRustVerilator
simulation_build_edge_detector_w32JIT compileVerilate + C++ compile
simulation_tick_edge_detector_w32_x1Single tickSingle tick
testbench_tick_edge_detector_w32_x10000001M tick + read1M tick + read

std::onehot (W=64) — One-hot and zero detection. Combinational.

BenchmarkRustVerilator
simulation_build_onehot_w64JIT compileVerilate + C++ compile
simulation_eval_onehot_w64_x1Single evalSingle eval
simulation_eval_onehot_w64_x10000001M evals1M evals

std::lfsr_galois (SIZE=32) — Galois-mode linear feedback shift register. Sequential.

BenchmarkRustVerilator
simulation_build_lfsr_w32JIT compileVerilate + C++ compile
simulation_tick_lfsr_w32_x1Single tickSingle tick
simulation_tick_lfsr_w32_x10000001M ticks1M ticks
testbench_tick_lfsr_w32_x10000001M tick + read1M tick + read

API & Overhead

BenchmarkDescription
simulator_tick_x10000Raw Simulator::tick overhead (Rust & TS)
simulation_step_x20000Simulation::step time-based API overhead (Rust & TS)

Running Locally

Rust

bash
cargo bench -p celox

TypeScript

bash
pnpm bench

This builds the NAPI addon in release mode, builds packages, then runs Vitest benchmarks.

Verilator

bash
bash scripts/run-verilator-bench.sh

Requires verilator and a C++ toolchain.

CI Environment

Benchmarks run on GitHub Actions shared runners (ubuntu-latest). Because these runners share hardware with other workloads, some noise in the results is expected. The alert threshold is set to 200% to avoid false positives. Focus on long-term trends rather than individual data points.