Skip to content

Metrics & Benchmarks

NOTE

These results are auto-generated from the latest bun run bench:save run.

1. Cold Evaluation [Direct SmartCal()]

ScenarioThroughputLatencyMedian
Simple Arithmetic257.1K ops/s4 µs3 µs
Polynomial 11 Variables31.8K ops/s31 µs22 µs
XXL Monster Formula (26 Variables)26.7K ops/s37 µs32 µs
Deep Nested Ternary Decision Tree82.4K ops/s12 µs10 µs
Boolean Logic XXL62.0K ops/s16 µs11 µs
Cascading DAG (8 Nested f_* Formulas)46.8K ops/s21 µs18 µs

2. Hot Precompiled Evaluation [JIT Mode]

ScenarioThroughputLatencyMedian
Simple Arithmetic [JIT]2.4M ops/s420 ns252 ns
Polynomial 11 Variables [JIT]567.5K ops/s2 µs1 µs
XXL Monster Formula 26 Vars [JIT]157.2K ops/s6 µs5 µs
Deep Ternary Tree [JIT]2.6M ops/s391 ns335 ns
Boolean Logic XXL [JIT]1.8M ops/s556 ns475 ns

3. Hot Precompiled Evaluation [Fast VM Mode]

ScenarioThroughputLatencyMedian
Simple Arithmetic [VM]2.8M ops/s356 ns290 ns
Polynomial 11 Variables [VM]297.0K ops/s3 µs3 µs
XXL Monster Formula 26 Vars [VM]114.6K ops/s9 µs7 µs
Deep Ternary Tree [VM]1.3M ops/s783 ns668 ns
Boolean Logic XXL [VM]759.0K ops/s1 µs1 µs

4. Lexing & Parsing Throughput

ScenarioThroughputLatencyMedian
Zero-Allocation Scanner (XXL Formula)76.1K ops/s13 µs11 µs
Pratt Parser AST Generation (XXL Formula)49.0K ops/s20 µs18 µs
Full Compilation Phase: compile(polyFormula)40.8K ops/s24 µs20 µs
Validation Phase: isValidExpression(deepTernary)118.4K ops/s8 µs7 µs

Benchmark Reproducibility

You can re-run the official benchmark suite at any time:

bash
bun run bench

To save a baseline reference and compare your future modifications:

bash
# Save current version results
bun run bench:save

# Automatically compare with baseline
bun run bench:compare

Released under MIT License.