Benchmarks
Greengold, C++, and Rust on seventeen workloads, measured on 9 October 2026. Full numbers: benchmarks/data.json.
The builds are g++ -O3, rustc -C opt-level=3, and greengold build --release. --release keeps bounds checks and integer overflow traps.
Timed programs show the median of five runs. The primes drag race is one run of about 20 seconds, scored by completed passes. Memory is peak working set. On each chart, languages run from best to worst, left to right. A gap of 5% or less is treated as noise.
AMD Ryzen 5 5600X (6 cores, 12 threads), 32 GB DDR4-3600, Windows 11 Pro build 26200. g++ 15.2.0, rustc 1.99.0-nightly (12c36e253, 2026-08-10), Python 3.11.5, llvmlite 0.42.0.
Fibonacci · Collatz · Fannkuch · Mandelbrot · N-body · Spectral · Matmul · Heat · Monte Carlo · FNV · Quicksort · Dijkstra · Sieve · Primes · Vector · Trees · Particle
Gaps
Median against the faster of C++ and Rust.
Within 5%
| Program | C++ | Rust | Greengold | Gap |
|---|---|---|---|---|
| collatz | 479.48 | 432.80 | 447.82 | +15.02 ms3.5% |
| mandel | 322.52 | 326.18 | 332.68 | +10.16 ms3.2% |
| spectral | 221.06 | 211.73 | 216.51 | +4.78 ms2.3% |
| heat | 135.84 | 136.50 | 139.26 | +3.42 ms2.5% |
| monte | 425.72 | 389.54 | 393.09 | +3.55 ms0.9% |
| fnv | 301.57 | 346.50 | 301.61 | +0.04 ms0.0% |
| trees | 487.60 | 484.03 | 493.15 | +9.12 ms1.9% |
Above 5%
Median runtime
Milliseconds. Lower is faster.
| Program | C++ | Rust | Greengold |
|---|---|---|---|
| fib(41) | 260.46 | 387.70 | 42.27 |
| collatz | 479.48 | 432.80 | 447.82 |
| fannkuch | 450.89 | 387.17 | 481.05 |
| mandel | 322.52 | 326.18 | 332.68 |
| nbody | 257.50 | 251.31 | 287.30 |
| spectral | 221.06 | 211.73 | 216.51 |
| matmul | 427.07 | 411.66 | 338.04 |
| heat | 135.84 | 136.50 | 139.26 |
| monte | 425.72 | 389.54 | 393.09 |
| fnv | 301.57 | 346.50 | 301.61 |
| qsort | 563.86 | 512.55 | 452.76 |
| dijkstra | 191.72 | 175.20 | 165.85 |
| sieve | 18.07 | 17.24 | 21.53 |
| vector | 83.23 | 84.29 | 80.36 |
| trees | 487.60 | 484.03 | 493.15 |
| particle | 19.64 | 19.81 | 12.25 |
On this run, Greengold’s median is the lowest on fib, matmul, qsort, dijkstra, vector, and particle. On the primes drag race it completed the most passes.
Primes drag race
Completed sieve passes. The program loops for about 20 seconds. Higher is faster.
| Program | C++ | Rust | Greengold |
|---|---|---|---|
| primes | 29365 | 31641 | 32240 |
Fibonacci
Recursive fib(41). Each program printed 165580141. The Greengold version uses overflow: wrap.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 260.46 ms | 269.76 ms | 4.66 MB | 0.45 s | 64.0 KB |
| Rust (opt-level = 3) | 387.70 ms | 412.68 ms | 4.19 MB | 0.26 s | 137.0 KB |
| Greengold --release | 42.27 ms | 44.13 ms | 4.07 MB | 0.33 s | 58.2 KB |
Collatz
For each integer from 1 up to, but not including, 4,000,000, count the steps until the value reaches 1. All three programs printed 3732423 and 596. Greengold is about the same as Rust.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 479.48 ms | 492.31 ms | 4.63 MB | 0.40 s | 59.4 KB |
| Rust (opt-level = 3) | 432.80 ms | 448.71 ms | 4.17 MB | 0.17 s | 128.0 KB |
| Greengold --release | 447.82 ms | 451.19 ms | 4.07 MB | 0.33 s | 58.2 KB |
Source: collatz.gg · collatz.cpp · collatz.rs
Fannkuch
Every permutation of ten items, repeated four times. Each program printed 292784 and 38. Greengold indexes with trust inside hot fn, and the checksum uses overflow: wrap.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 450.89 ms | 457.82 ms | 4.62 MB | 0.43 s | 59.8 KB |
| Rust (opt-level = 3) | 387.17 ms | 408.37 ms | 4.18 MB | 0.20 s | 128.5 KB |
| Greengold --release | 481.05 ms | 491.14 ms | 4.07 MB | 0.37 s | 59.4 KB |
Source: fannkuch.gg · fannkuch.cpp · fannkuch.rs
Mandelbrot
2048 by 2048 pixels, at most 80 iterations, on the plane [−1.5, 0.5] × [−1, 1]. Each program printed 1632341, the count of pixels that reached 80 iterations. The Greengold iterator is hot fn with overflow: wrap. Greengold is about the same as C++.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 322.52 ms | 327.26 ms | 4.63 MB | 0.41 s | 59.7 KB |
| Rust (opt-level = 3) | 326.18 ms | 356.47 ms | 4.17 MB | 0.17 s | 127.5 KB |
| Greengold --release | 332.68 ms | 334.97 ms | 4.07 MB | 0.35 s | 59.4 KB |
Source: mandel.gg · mandel.cpp · mandel.rs
N-body
768 bodies, 160 steps, softening 0.05. Positions are parallel arrays in all three programs. Greengold uses hot fn, exclusive lend, trust, and overflow: wrap. Each program printed -51022, 15923, and 45852.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 257.50 ms | 265.12 ms | 4.66 MB | 0.55 s | 65.3 KB |
| Rust (opt-level = 3) | 251.31 ms | 258.31 ms | 4.20 MB | 0.22 s | 132.5 KB |
| Greengold --release | 287.30 ms | 279.73 ms | 4.11 MB | 0.46 s | 62.2 KB |
Spectral
Power iteration on an implicit matrix, n = 1600, forty applications of A twice. Greengold uses hot fn, exclusive lend, trust, and overflow: wrap. Each program printed 1122277722. Greengold is about the same as Rust.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 221.06 ms | 226.21 ms | 4.66 MB | 0.54 s | 62.1 KB |
| Rust (opt-level = 3) | 211.73 ms | 243.34 ms | 4.18 MB | 0.26 s | 129.0 KB |
| Greengold --release | 216.51 ms | 223.44 ms | 4.09 MB | 0.67 s | 60.8 KB |
Source: spectral.gg · spectral.cpp · spectral.rs
Matmul
Naive i-k-j product of two 1216×1216 f64 matrices. Greengold uses hot fn, exclusive lend, trust, and overflow: wrap. Each program printed 86306145685, 58018, and 58672. Greengold’s peak memory is 39.66 MB; C++ is 38.01 MB and Rust is 37.58 MB.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 427.07 ms | 406.20 ms | 38.01 MB | 0.55 s | 63.2 KB |
| Rust (opt-level = 3) | 411.66 ms | 480.18 ms | 37.58 MB | 0.22 s | 130.0 KB |
| Greengold --release | 338.04 ms | 348.30 ms | 39.66 MB | 0.37 s | 60.7 KB |
Source: matmul.gg · matmul.cpp · matmul.rs
Heat
Jacobi stencil on a 1024×1024 grid, 320 steps. Greengold uses hot fn, exclusive lend, trust, and overflow: wrap. Each program printed 9259564379. Greengold is about the same as C++ and Rust.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 135.84 ms | 144.34 ms | 20.16 MB | 0.51 s | 62.2 KB |
| Rust (opt-level = 3) | 136.50 ms | 192.26 ms | 19.73 MB | 0.22 s | 130.5 KB |
| Greengold --release | 139.26 ms | 168.86 ms | 20.69 MB | 0.41 s | 60.7 KB |
Monte Carlo
One hundred twenty million xorshift64* samples. The printed value is the number of points inside the unit circle. Greengold keeps the generator in one hot fn with overflow: wrap. Each program printed 94241925. Greengold is about the same as Rust.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 425.72 ms | 432.05 ms | 4.63 MB | 0.45 s | 59.3 KB |
| Rust (opt-level = 3) | 389.54 ms | 395.52 ms | 4.17 MB | 0.17 s | 128.0 KB |
| Greengold --release | 393.09 ms | 405.47 ms | 4.07 MB | 0.32 s | 58.2 KB |
FNV
FNV-1a 64 over eight million generated bytes, forty salted passes. Greengold hashes inside hot fn with wrapping arithmetic. Each program printed 16483032082770582304. Greengold is about the same as C++.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 301.57 ms | 307.16 ms | 11.79 MB | 0.51 s | 61.5 KB |
| Rust (opt-level = 3) | 346.50 ms | 359.37 ms | 11.35 MB | 0.20 s | 128.0 KB |
| Greengold --release | 301.61 ms | 308.22 ms | 12.66 MB | 0.34 s | 59.6 KB |
Quicksort
Iterative quicksort of eight million i32 values, with insertion sort below 16 elements. Greengold uses hot fn, trust, and overflow: wrap. Each program printed 14, 1073845253, 2147483383, 8590112052113664, and 0. The last value is 0 when the array is sorted.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 563.86 ms | 574.70 ms | 34.68 MB | 0.53 s | 63.8 KB |
| Rust (opt-level = 3) | 512.55 ms | 546.05 ms | 34.24 MB | 0.24 s | 130.5 KB |
| Greengold --release | 452.76 ms | 447.55 ms | 36.64 MB | 0.41 s | 60.7 KB |
Dijkstra
Eight dense shortest-path searches on 4,000 nodes. Edge weights are computed, not stored. Greengold uses hot fn, exclusive lend, trust, and overflow: wrap. Each program printed 251696.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 191.72 ms | 197.87 ms | 4.65 MB | 0.48 s | 62.0 KB |
| Rust (opt-level = 3) | 175.20 ms | 210.86 ms | 4.20 MB | 0.26 s | 129.0 KB |
| Greengold --release | 165.85 ms | 169.09 ms | 4.07 MB | 0.42 s | 60.2 KB |
Source: dijkstra.gg · dijkstra.cpp · dijkstra.rs
Sieve
Count the primes below 8,000,000. Each program printed 539777. The Greengold program indexes with trust. Rust’s mean, 76.62 ms, sits well above its median, 17.24 ms.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 18.07 ms | 25.67 ms | 11.74 MB | 0.52 s | 61.6 KB |
| Rust (opt-level = 3) | 17.24 ms | 76.62 ms | 11.32 MB | 0.19 s | 128.0 KB |
| Greengold --release | 21.53 ms | 27.85 ms | 12.65 MB | 0.35 s | 59.6 KB |
Primes
A one-bit sieve of limit 1,000,000, repeated for about 20 seconds. The score is completed passes. Each program counted 78,498 primes. Greengold indexes the bit words with trust.
| Build | Passes | Passes/s | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 29365 | 1462.2 | 4.61 MB | 0.64 s | 94.3 KB |
| Rust (opt-level = 3) | 31641 | 1578.0 | 4.17 MB | 0.21 s | 155.0 KB |
| Greengold --release | 32240 | 1609.6 | 4.43 MB | 0.39 s | 60.6 KB |
Source: primes.gg · primes.cpp · primes.rs
Vector
Push the integers 0 through 19,999,999 onto a list, then sum them. All three programs printed 20000000 and 199999990000000. Peak memory is about 261 MB because the list holds twenty million i64 values.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 83.23 ms | 89.01 ms | 261.11 MB | 0.43 s | 61.5 KB |
| Rust (opt-level = 3) | 84.29 ms | 90.54 ms | 260.71 MB | 0.20 s | 128.5 KB |
| Greengold --release | 80.36 ms | 83.24 ms | 260.65 MB | 0.35 s | 59.6 KB |
Source: vector.gg · vector.cpp · vector.rs
Trees
A full binary tree of depth 16, built and counted eighty times, then freed. Greengold stores children in Box and walks the tree by borrow. Each program printed 5242880. Greengold is about the same as Rust and C++.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 487.60 ms | 525.59 ms | 8.23 MB | 1.13 s | 110.6 KB |
| Rust (opt-level = 3) | 484.03 ms | 515.88 ms | 7.76 MB | 0.18 s | 129.0 KB |
| Greengold --release | 493.15 ms | 512.27 ms | 7.70 MB | 0.37 s | 60.6 KB |
Particle
20,000 particles, 2,000 steps, then the sum of x. Greengold uses soa Array and indexes it with trust inside hot fn. C++ and Rust store an array of structs. Printed sums: C++ 5.99982e+07, Rust 59998190, Greengold 5.9999e+07. Rust’s mean, 66.71 ms, sits well above its median, 19.81 ms.
| Build | Median | Mean | Memory | Compile | Binary |
|---|---|---|---|---|---|
| C++ (GCC -O3) | 19.64 ms | 25.86 ms | 4.97 MB | 0.45 s | 60.5 KB |
| Rust (opt-level = 3) | 19.81 ms | 66.71 ms | 4.46 MB | 0.19 s | 150.0 KB |
| Greengold --release | 12.25 ms | 16.66 ms | 4.41 MB | 2.11 s | 58.9 KB |
Source: particle.gg · particle.cpp · particle.rs