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.

Compile time · median (cold)

median of 7 runs

Native Gocompiled
109 ms82.7×
Pipitbytecode VM
1.31 msbaseline
CPython 3.14bytecode VM
443 µs0.34×
PyPy 7.3tracing JIT
343 µs0.26×
Ttengobytecode VM
245 µs0.19×
Sscriggobytecode VM
508 µs0.39×
Mmvmbytecode VM
439 µs0.33×
YyaegiAST walker
439 µs0.33×

Full statistics

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