Skip to content

Benchmarks

ABCrimson edited this page Mar 11, 2026 · 2 revisions

Benchmarks

Performance baselines measured on Ubuntu 24.04, Node.js 25.8.0, with 3-run averaging via Math.sumPrecise.

Head-to-Head vs cmdk

Raw filter throughput across 15 scenarios (100 / 1K / 10K items x 5 query types):

Dataset Query cmdk modern-cmdk Result
100 items "app" 0.091 ms 0.058 ms 1.6x faster
100 items "banana" 0.055 ms 0.035 ms 1.6x faster
100 items "open settings" 0.075 ms 0.024 ms 3.1x faster
100 items "dshbrd" 0.048 ms 0.075 ms cmdk 1.6x
100 items "xyznotfound" 0.027 ms 0.020 ms 1.3x faster
1K items "app" 0.450 ms 0.421 ms 1.1x faster
1K items "banana" 1.150 ms 0.193 ms 5.9x faster
1K items "open settings" 0.455 ms 0.215 ms 2.1x faster
1K items "dshbrd" 0.292 ms 0.211 ms 1.4x faster
1K items "xyznotfound" 0.211 ms 0.162 ms 1.3x faster
10K items "app" 3.198 ms 1.938 ms 1.7x faster
10K items "banana" 2.853 ms 1.770 ms 1.6x faster
10K items "open settings" 4.254 ms 1.355 ms 3.1x faster
10K items "dshbrd" 2.342 ms 1.986 ms 1.2x faster
10K items "xyznotfound" 1.743 ms 1.672 ms 1.0x faster

modern-cmdk wins 14 of 15 benchmarks, up to 5.9x faster at scale.

Feature Comparison

Feature cmdk modern-cmdk
Basic command palette Yes Yes
Search filtering Yes Yes
Groups / Dialog / Loading / Empty / Keyboard nav Yes Yes
Custom filtering / Nested pages / Separator Yes Yes
Match highlighting -- Yes
Framework-agnostic core -- Yes
Pluggable search engine -- Yes
Incremental search optimization -- Yes
Keyboard shortcut registry -- Yes
Frecency ranking -- Yes
Branded type safety -- Yes
Disposable pattern (using) -- Yes
ES2026 Iterator pipeline -- Yes
Page navigation stack -- Yes
Error boundary -- Yes

11 exclusive features, 10 shared, 0 cmdk-only.

Absolute Results

Benchmark Target Median P99
Search 10K items (TS scorer) < 16 ms 8.2 ms 14.5 ms
Search 100K items (WASM scorer) < 1 ms 0.7 ms 0.9 ms
Filter 10K items (incremental) < 2 ms 1.1 ms 1.8 ms
Filter 100K items (incremental) < 8 ms 4.5 ms 7.2 ms
State update cycle < 4 ms 2.3 ms 3.8 ms

Running Benchmarks

# Vitest bench mode
pnpm bench

# CI benchmarks (standalone, tinybench)
pnpm bench:ci

# Compare against baseline
pnpm bench:compare

Regression Detection

The CI runs pnpm bench:compare which:

  1. Reads benchmarks/baseline.json
  2. Runs each benchmark 3 times
  3. Averages results with Math.sumPrecise
  4. Compares against baseline thresholds:
    • 5% regression → warning
    • 15% regression → CI failure

Updating Baselines

After intentional performance changes, update the baseline:

pnpm bench:ci
# Copy results to baseline.json

Clone this wiki locally