From 992210d3edca80df71689065178a2e5a1cfac009 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Tue, 17 Feb 2026 23:03:14 +0200 Subject: Add Jank support --- BENCHMARKS.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'BENCHMARKS.md') 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 -- cgit v1.2.3 From 66043d4f32ad371a9b7e61f76f2c8349acce3b16 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Tue, 17 Feb 2026 23:08:34 +0200 Subject: Keep it simple --- BENCHMARKS.md | 7 ------- 1 file changed, 7 deletions(-) (limited to 'BENCHMARKS.md') diff --git a/BENCHMARKS.md b/BENCHMARKS.md index 644db0f..f729d4c 100644 --- a/BENCHMARKS.md +++ b/BENCHMARKS.md @@ -191,10 +191,6 @@ Each benchmark: 2s warmup, 5s measurement window. ### 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 | @@ -235,9 +231,6 @@ the 0.1 Homebrew release has a `clojure.string` codegen bug fixed on main. ### 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 -- cgit v1.2.3