Host
Intel Core Ultra 9 285K · 24 cores
Platform
linux/amd64
Go
go1.27.0
CPython
python:3.14-slim
PyPy
pypy:3.11-slim
Runs / combo
7 + 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 7 runs

Native Gocompiled
2.57 ms0.03×
Pipitbytecode VM
80.4 msbaseline
CPython 3.14bytecode VM
115 ms1.44×
PyPy 7.3tracing JIT
24.7 ms0.31×
Ttengobytecode VM
181 ms2.25×
Sscriggobytecode VM
140 ms1.74×
Mmvmbytecode VM
149 ms1.85×
YyaegiAST walker
656 ms8.16×

Full statistics

RunnerNCompileRuntimeP95StddevRSSvs pipitStatus
Native Gocompiled7109 ms2.57 ms2.75 ms98.7 µs1.62 GiB0.03×OK
Pipitbytecode VM71.31 ms80.4 ms103 ms7.96 ms592 MiB1.00×OK
CPython 3.14bytecode VM7443 µs115 ms117 ms2.13 msn/a1.44×OK
PyPy 7.3tracing JIT7343 µs24.7 ms26.2 ms725 µsn/a0.31×OK
tengobytecode VM7245 µs181 ms195 ms9.77 ms1.69 GiB2.25×OK
scriggobytecode VM7508 µs140 ms157 ms11.8 ms1.69 GiB1.74×OK
mvmbytecode VM7439 µs149 ms149 ms330 µs1.69 GiB1.85×OK
yaegiAST walker7439 µs656 ms681 ms9.08 ms1.69 GiB8.16×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