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

N-body solar system

50,000 integration steps of the outer solar system (Sun + Jupiter, Saturn, Uranus, Neptune) using the canonical Computer Language Benchmarks Game initial conditions. Hot loop is struct-field access through a slice under FP load.

Compile time · median (cold)

median of 10 runs

Native Gocompiled
183 ms85.9×
Piko interpbytecode VM
2.13 msbaseline
CPython 3.13bytecode VM
508 µs0.24×
PyPy 7.3tracing JIT
423 µs0.20×
Ttengobytecode VM
414 µs0.19×
Sscriggobytecode VM
771 µs0.36×
Mmvmbytecode VM
744 µs0.35×
YyaegiAST walker
792 µs0.37×

Full statistics

RunnerNCompileRuntimeP95StddevRSSvs pikoStatus
Native Gocompiled10183 ms8.16 ms8.17 ms2.76 µs68 MiB85.9×OK
Piko interpbytecode VM102.13 ms533 ms541 ms3.38 ms105 MiB1.00×OK
CPython 3.13bytecode VM10508 µs393 ms405 ms6.13 msn/a0.24×OK
PyPy 7.3tracing JIT10423 µs27.1 ms28.9 ms550 µsn/a0.20×OK
tengobytecode VM10414 µs1.14 s1.18 s32.6 ms2.18 GiB0.19×OK
scriggobytecode VM10771 µs960 ms989 ms18.9 ms687 MiB0.36×OK
mvmbytecode VM10744 µs1.15 s1.19 s24.0 ms66 MiB0.35×OK
yaegiAST walker10792 µs1.55 s1.70 s90.2 ms66 MiB0.37×OK
Workload & symmetry rules

Workload

Gravitational simulation of five bodies (Sun, Jupiter, Saturn, Uranus, Neptune) over 50,000 time steps. Each step computes pair-wise gravitational impulses for every (i, j) pair, then integrates positions from velocities. Output is the conserved energy before and after, each multiplied by 1e9 and rounded to integer.

Symmetry rules

  • Bodies are stored as a slice of records with named fields (Body struct on Go, class with __slots__ on Python). The hot loop pays struct-field-access cost on every runner.
  • Tengo has no struct type, so its translation uses parallel arrays (struct-of-arrays) over the seven body fields. Shape of the hot loop is otherwise identical.
  • math.Sqrt / math.sqrt is the only stdlib intrinsic allowed; sqrt is implemented identically (libm) across every runner so its cost does not distort the comparison.

Banned

  • Numpy, scipy, gonum, hand-written assembly, any SIMD shortcut.
  • Threading or process parallelism. This benchmark is single-threaded serial throughput by design (bench 16 covers parallelism).

Why this benchmark exists

The unique signal: struct field access inside an FP hot loop. Bench 14 uses four local scalar floats and no struct. Bench 21 uses 2D float arrays. Neither stresses the struct path. piko's struct-in-typed-slice path is the open Phase 7 (struct unboxing) area; this benchmark gives a clean before-after measurement of any work on that path.

Source code