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.

Compile time · median (cold)

median of 10 runs

Native Gocompiled
180 ms138×
Piko interpbytecode VM
1.31 msbaseline
CPython 3.13bytecode VM
387 µs0.30×
PyPy 7.3tracing JIT
308 µs0.24×
Ttengobytecode VM
271 µs0.21×
Sscriggobytecode VM
395 µs0.30×
Mmvmbytecode VM
482 µs0.37×
YyaegiAST walker
549 µs0.42×

Full statistics

RunnerNCompileRuntimeP95StddevRSSvs pikoStatus
Native Gocompiled10180 ms2.36 ms2.46 ms99.6 µs68 MiB138×OK
Piko interpbytecode VM101.31 ms150 ms150 ms485 µs173 MiB1.00×OK
CPython 3.13bytecode VM10387 µs115 ms120 ms2.67 msn/a0.30×OK
PyPy 7.3tracing JIT10308 µs22.0 ms22.7 ms399 µsn/a0.24×OK
tengobytecode VM10271 µs242 ms254 ms17.7 ms2.69 GiB0.21×OK
scriggobytecode VM10395 µs148 ms152 ms9.41 ms279 MiB0.30×OK
mvmbytecode VM10482 µs179 ms205 ms12.1 ms66 MiB0.37×OK
yaegiAST walker10549 µs810 ms837 ms22.7 ms74 MiB0.42×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