Host
Intel Core Ultra 9 285K · 24 cores
Platform
linux/amd64
Go
go1.26.0
CPython
python:3.13-slim
PyPy
pypy:3.10-slim
Runs / combo
10 + 2 warmup

Closures pipeline

Map/Filter/Map/Filter/Reduce over 100k integers, every stage a closure built by a factory function.

Runtime · median per inner-loop window

median of 10 runs

Native Gocompiled
2.36 ms0.02×
Piko interpbytecode VM
150 msbaseline
CPython 3.13bytecode VM
115 ms0.77×
PyPy 7.3tracing JIT
22.0 ms0.15×
Ttengobytecode VM
242 ms1.62×
Sscriggobytecode VM
148 ms0.99×
Mmvmbytecode VM
179 ms1.20×
YyaegiAST walker
810 ms5.40×

Full statistics

RunnerNCompileRuntimeP95StddevRSSvs pikoStatus
Native Gocompiled10180 ms2.36 ms2.46 ms99.6 µs68 MiB0.02×OK
Piko interpbytecode VM101.31 ms150 ms150 ms485 µs173 MiB1.00×OK
CPython 3.13bytecode VM10387 µs115 ms120 ms2.67 msn/a0.77×OK
PyPy 7.3tracing JIT10308 µs22.0 ms22.7 ms399 µsn/a0.15×OK
tengobytecode VM10271 µs242 ms254 ms17.7 ms2.69 GiB1.62×OK
scriggobytecode VM10395 µs148 ms152 ms9.41 ms279 MiB0.99×OK
mvmbytecode VM10482 µs179 ms205 ms12.1 ms66 MiB1.20×OK
yaegiAST walker10549 µs810 ms837 ms22.7 ms74 MiB5.40×OK
Workload & symmetry rules

Workload

Generate 100,000 uint32 values from an LCG. Pipe them through five stages, each a closure built by a factory function that captures one constant:

  1. applyMap(makeMultiply(3)), capturing factor 3
  2. applyFilter(makeDivisorFilter(7)), capturing divisor 7
  3. applyMap(makeAdd(1234)), capturing offset 1234
  4. applyFilter(makeThresholdFilter(1000)), capturing threshold 1000
  5. applyReduce(makeFold(5)), capturing shift 5

Symmetry rules

  • Every stage is a real closure with captured state (not a top-level function).
  • Pipeline composition through ordinary function calls, no tail-call tricks.

Why this benchmark exists

Measures first-class-function dispatch under load. Every element walks through five closure invocations. Closure allocation and upvalue access dominate the inner loop.

Source code