diff options
| author | Asko Nõmm <asko@nmm.ee> | 2026-02-17 23:03:14 +0200 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2026-02-17 23:03:14 +0200 |
| commit | 992210d3edca80df71689065178a2e5a1cfac009 (patch) | |
| tree | 8b9351f7a518f4d39a06cdcfd775a86bd6abc029 /BENCHMARKS.md | |
| parent | a03d592ed88854aee6ca130e64cdf8388534c5a3 (diff) | |
Add Jank support
Diffstat (limited to 'BENCHMARKS.md')
| -rw-r--r-- | BENCHMARKS.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/BENCHMARKS.md b/BENCHMARKS.md index ef8b350..644db0f 100644 --- a/BENCHMARKS.md +++ b/BENCHMARKS.md @@ -8,6 +8,7 @@ Each benchmark: 2s warmup, 5s measurement window. - **JVM**: Java 25.0.2, Clojure 1.10.3 - **ClojureScript**: 1.10.879, Node.js v24.11.1 - **Babashka**: 1.12.212 +- **Jank**: built from source (latest main, ~Feb 2025), interpreted, LLVM 22 ## JVM (Clojure) @@ -186,6 +187,31 @@ Each benchmark: 2s warmup, 5s measurement window. | Large (202) — match last | 4,157 | 290,664 | 70x | | Large (202) — miss (404) | 4,206 | 767,125 | 182x | +## Jank (built from source, latest main) + +### v2.1.0 + +Jank is currently in alpha with an interpreted runtime (no JIT). Uses +`clojure.string` directly (same as JVM/BB). Requires building Jank from source; +the 0.1 Homebrew release has a `clojure.string` codegen bug fixed on main. + +| Scenario | Ops/sec | ns/op | +|---|---:|---:| +| Small (5) — literal first | 91,466 | 10,932 | +| Small (5) — literal middle | 63,483 | 15,752 | +| Small (5) — param match | 29,092 | 34,373 | +| Small (5) — nested params | 24,136 | 41,430 | +| Small (5) — wildcard | 23,772 | 42,065 | +| Small (5) — miss (404) | 94,463 | 10,586 | +| Medium (52) — match first | 95,493 | 10,471 | +| Medium (52) — match middle | 27,171 | 36,803 | +| Medium (52) — match last | 26,904 | 37,168 | +| Medium (52) — catch-all wildcard | 32,048 | 31,203 | +| Large (202) — match first | 94,151 | 10,621 | +| Large (202) — match middle | 26,602 | 37,590 | +| Large (202) — match last | 26,916 | 37,152 | +| Large (202) — miss (404) | 68,021 | 14,701 | + ## Analysis ### JVM (Clojure) @@ -206,6 +232,13 @@ Each benchmark: 2s warmup, 5s measurement window. - **Large route sets**: 32–182x faster - Peak throughput: ~1.1M ops/sec (miss/404 — fast trie rejection) +### Jank (built from source, latest main) +- Peak throughput: ~95K ops/sec (literal match / miss) +- Performance is roughly 8–10x slower than Babashka, expected for an alpha interpreted runtime +- ~1.5x faster than 0.1 Homebrew release, likely due to bug fixes and optimizations on main +- The trie structure still provides O(path-depth) matching; throughput will improve as Jank matures and adds JIT compilation +- Uses `clojure.string` directly — no C++ interop needed for core routing + ### Key insight v2.0 performance is nearly independent of route count across all runtimes. Matching is O(path depth) via the trie, not O(route count) via linear scan. The improvement is most dramatic for large route sets where v1.x's linear scan with per-request regex compilation becomes the dominant bottleneck. @@ -223,6 +256,9 @@ node bench-out/bench.js # Babashka bb -m ruuter.bench + +# Jank +jank run --module-path src:bench jank_bench_runner.jank ``` ### Route set sizes |
