Skip to content
EN / JA

Benchmarks


When comparing zenpix and Sharp, two axes matter: wall-clock and CPU user.

MetricMeaningzenpix position
wall-clockReal elapsed time until completionSharp leads (faster for single requests)
CPU userTotal CPU time consumed across all coreszenpix is significantly lower

Why CPU user matters: On a 2–4 core VPS handling concurrent requests, high CPU user time means cores compete for work, directly increasing latency for other requests. A faster wall-clock tool that burns more CPU will hurt overall throughput as concurrency grows.


Single-point Comparison (manual measurement)

Section titled “Single-point Comparison (manual measurement)”

Condition: 3840×2160 PNG → 1920×1080 AVIF (quality=60)
Environment: macOS aarch64 (Apple M4 Pro), illustration fixture (bench_chara_chika.png)
Measurement: /usr/bin/time, warm-up 3 / measure 7, median
Version: zenpix 0.8.0

Toolwall-clockCPU userFile size
Sharp quality=60 (libvips auto-thread)0.422s2.630s63 KB
zenpix speed=10 (single-thread)0.512s0.530s106 KB
zenpix speed=6 (single-thread)0.992s1.000s73 KB
zenpix speed=6 (threads=14)0.610s1.060s73 KB

Key takeaways:

  • Sharp wins on wall-clock (0.422s)
  • zenpix CPU user is ~40% of Sharp (1.060s vs 2.630s)
  • threads=14 cuts speed=6 wall-clock from 0.992s → 0.610s (−38%) with nearly flat CPU user

Condition: PNG decode → Sharp resize to each resolution → AVIF encode (quality=60 / speed=6)
warm-up 2, measure 10; each cell is the median wall-clock (ms)
ratio = Sharp median ÷ zenpix median (> 1 means zenpix is faster)

3 runs; median of 3 values per cell. Measured 2026-05-04, zenpix 0.4.0.

FixtureFHD (ratio)WQHD (ratio)4K (ratio)
bench_input (tile)0.260.250.24
bench_chara_chika1.351.261.21
bench_chara_kanata1.361.271.21
bench_landscape_dark1.131.200.97
bench_landscape_impasto1.471.371.44
bench_landscape_light1.030.930.79

Trend: Tile images (bench_input) favor Sharp. Character art and impasto landscapes favor zenpix.

3 runs; median of 3 values per cell. Measured 2026-04-15.

FixtureFHD (ratio)WQHD (ratio)4K (ratio)
bench_input0.260.180.15
bench_chara_chika0.600.440.41
bench_chara_kanata0.630.460.38
bench_landscape_dark0.550.510.38
bench_landscape_impasto0.570.440.37
bench_landscape_light0.530.460.35

Trend: All cells < 1 on Mac (Sharp wins). The Mac table is used for regression detection; the VPS table is the externally relevant one.

Same conditions, same fixtures, with threads=14 (os.cpus().length) passed to encodeAvif. Measured 2026-05-04.

FixtureFHD (ratio)WQHD (ratio)4K (ratio)
bench_input0.330.220.19
bench_chara_chika1.010.770.69
bench_chara_kanata1.000.760.70
bench_landscape_dark0.690.760.54
bench_landscape_impasto0.950.720.78
bench_landscape_light0.740.640.48

Trend: All rows improve over single-thread. Character art FHD reaches parity with Sharp (1.00–1.01).


Use caseRecommendation
Single-request wall-clock prioritySharp
VPS / low-core concurrent workloadszenpix (CPU user ~40% of Sharp)
Per-call CPU budget controlzenpix (threads option)
Illustration / character AVIF on VPSzenpix (ratio 1.2–1.5)

Speed is one dimension — visual quality is another. At the same quality=60 setting, zenpix preserves more tonal nuance in illustration content. Sharp discards subtle gradients more aggressively to achieve a smaller file size.

Sharp (quality=60)zenpix (quality=60)
Sharp outputzenpix output

Pastel beach illustration. Sharp produces a smaller file by discarding subtle color transitions; zenpix retains them at a slightly larger size.


Terminal window
npm run build
npx tsx bench/bench.ts
# Filter fixtures
BENCH_FIXTURES=bench_input,bench_chara_chika npx tsx bench/bench.ts
# Multi-thread measurement
npm run bench:threads
# Quality-matched comparison
npm run bench:quality

Results are written to bench/results/benchmark.json and benchmark.md.