The same input and the same kernels, in neo's C++ and in Go. Across 5 measurements neo finished 2.22× faster in the middle and 4.45× at most; Go was not quicker on any.
01 · The race
One kernel at a time
Each piece of work below has its own race, what it measures, how each side does it, the code that ran and every number taken for it. In a race both ships run for the same stretch: Go completes the work once, and neo completes it as many times as the measured ratio says, turning around at each end.
Read a 46 MB CSV of a million rows and six columns into a table: split the bytes into fields, parse the amount column into numbers, and dictionary-encode the region column. Each engine's typed read, best of two, with the first read of a fresh process kept separately.
How neo does it
neo's parser finds the structural characters with SIMD, splits the file into blocks and parses them on every core above a megabyte, with results identical to the serial path. Typing and the dictionary happen once, at load, on the pool, so no kernel after it touches text. In the ledger's breakdown that is 2.8 ms of parse, 0.2 ms of typing and about nothing for the dictionary.
How Go does it
The port's load is the whole program rather than one function, so it is not excerpted here: neon-cpp/bench/lang/go/main.go.
neo's side: the call and the contract
the harness, calling the engine · neon-cpp/bench/bench_engine_options.cpp:194
Count the rows whose amount is over 500: a million comparisons on a typed column, the answer one integer. Each library's count is written the way its users write it.
How neo does it
neo's filter produces a bitmap: one bit per row, 125 KB for a million rows, written at memory speed, with indices made only when something needs them. Below about a million values it runs on one thread, above that on the pool. The contract is the JavaScript node's: NaN never matches.
How Go does it
Two passes on the pool. Each chunk counts its hits, a running total gives every chunk its own slice of the output, and each chunk then writes its row numbers into that slice.
filter amount > 500 · neon-cpp/bench/lang/go/main.go:818 · show all 44 lines
func filterGT(amt []float64, thr float64, p *pool) []uint32 {
n := len(amt)
if p == nil {
out := make([]uint32, n+1)
k := 0
for i, v := range amt {
out[k] = uint32(i)
if v > thr {
k++
}
}
return out[:k]
}
C := p.chunks()
bases := make([]int, C+1)
p.run(C, n, func(c, lo, hi int) {
cnt := 0
for _, v := range amt[lo:hi] {
if v > thr {
cnt++
}
}
bases[c+1] = cnt
})
for c := 0; c < C; c++ {
bases[c+1] += bases[c]
}
total := bases[C]
out := make([]uint32, total+C)
p.run(C, n, func(c, lo, hi int) {
k, end, dummy := bases[c], bases[c+1], total+c
for i := lo; i < hi; i++ {
pos := k
if pos >= end {
pos = dummy
}
out[pos] = uint32(i)
if amt[i] > thr {
k++
}
}
})
return out[:total]
}
neo's side: the call and the contract
the harness, calling the engine · neon-cpp/bench/bench_engine_options.cpp:337
const double f5 = timeIt([&] { Bitmap b = compareDoubles(amt.data(), n, Cmp::Gt, 500, &pool); sink = b.words[0]; }, 7);
the filter's contract · neon-cpp/core/selection.h:1
// selection.h — the result of a filter: one bit per row. 1M rows = 125 KB,
// written at memory speed; indices are produced only when something needs them.
struct Bitmap {
std::vector<uint64_t> words;
size_t bits = 0;
bool test(size_t i) const { return (words[i >> 6] >> (i & 63)) & 1; }
size_t count() const;
std::vector<uint32_t> indices() const; // ascending row indices of the set bits
};
// JS measurefilter semantics: NaN never matches. Sequential below ~1M values; the pool otherwise.
Bitmap compareDoubles(const double* v, size_t n, Cmp op, double threshold, Pool* pool);
Every number taken for it
measurement
neo
Go
× neo
time, msBest of three in one process, then the median over seven rounds, every engine run once a round in a shuffled order.
0.017
0.074
4.35×
Read it with this
The two results differ in form: neo's figure is for a bitmap, the port's for a list of row numbers.
Taken on a shared machine. Both columns ran in the same shuffled rounds, so the multiple stands, but the times themselves read high.
Produce the stable ascending order of the amount column as a permutation of row indices, without moving any other column. SQL engines have no such form, so DuckDB and Spark sit this one out.
How neo does it
neo turns each double into a sortable 64-bit key and runs an LSD radix sort on the pool: O(n), stable, with the JavaScript rule that NaN sorts as negative infinity and ties keep their order. The ledger's design levers show the step from std::stable_sort at 84 ms, to radix at 14 ms, to the pool at 1 ms.
How Go does it
Each double becomes a sortable 64-bit key beside its row number, both filled on the pool, and a parallel radix sort orders them.
sort, as a permutation · neon-cpp/bench/lang/go/main.go:895
func sortPerm(amt []float64, p *pool) []uint32 {
n := len(amt)
var keys, keys2 []uint64
var idx, idx2 []uint32
p.run(4, 4, func(c, _, _ int) { // zeroing 24 MB is not free: do it on four threads
switch c {
case 0:
keys = make([]uint64, n)
case 1:
keys2 = make([]uint64, n)
case 2:
idx = make([]uint32, n)
case 3:
idx2 = make([]uint32, n)
}
})
p.run(p.chunks(), n, func(_, lo, hi int) {
for i := lo; i < hi; i++ {
keys[i] = sortableKey(amt[i])
idx[i] = uint32(i)
}
})
if p == nil {
return radixSeq(keys, keys2, idx, idx2)
}
return radixPar(keys, keys2, idx, idx2, p)
}
neo's side: the call and the contract
the harness, calling the engine · neon-cpp/bench/bench_engine_options.cpp:372
// sort.h — stable O(n) sorting of row indices by a double key (parallel radix).
// JS numeric sort semantics: NaN sorts as -Infinity; ties keep input order.
// Fills `idx` with the stable ascending order of keys[0..n). pool may be null.
void sortIndexByDouble(const double* keys, size_t n, std::vector<uint32_t>& idx, Pool* pool);
Every number taken for it
measurement
neo
Go
× neo
time, msBest of three in one process, then the median over seven rounds, every engine run once a round in a shuffled order.
1.04
1.62
1.55×
Read it with this
Taken on a shared machine. Both columns ran in the same shuffled rounds, so the multiple stands, but the times themselves read high.
Sort by amount and build the whole sorted table, every column reordered.
How neo does it
The permutation from the radix sort drives a parallel gather of every column, with the dictionary column moved as ids. The ledger times the gather alone at under three milliseconds for a million rows.
How Go does it
Every column is gathered through the permutation on the pool, into a fresh arena of bytes and a fresh array of offsets.
sort into a new table · neon-cpp/bench/lang/go/main.go:1051 · show all 46 lines
func materialize(t *Table, perm []uint32, p *pool) *Table {
n, ncols := t.Rows, len(t.Cols)
out := &Table{Names: t.Names, Rows: n, Cols: make([]Column, ncols)}
p.run(ncols, ncols, func(c, _, _ int) {
out.Cols[c] = Column{Arena: make([]byte, int(t.Cols[c].Offs[n])+arenaSlack), Offs: make([]uint32, n+1)}
})
C := p.chunks()
sizes := make([]int, C+1)
for c := 0; c < ncols; c++ {
sa, so := t.Cols[c].Arena, t.Cols[c].Offs
da, do := out.Cols[c].Arena, out.Cols[c].Offs
if C == 1 {
sizes[1] = int(so[n])
} else {
p.run(C, n, func(ch, lo, hi int) {
sum := 0
for _, src := range perm[lo:hi] {
sum += int(so[src+1] - so[src])
}
sizes[ch+1] = sum
})
for ch := 0; ch < C; ch++ {
sizes[ch+1] += sizes[ch]
}
}
p.run(C, n, func(ch, lo, hi int) {
w, end := sizes[ch], sizes[ch+1]
for r := lo; r < hi; r++ {
q := perm[r]
s, e := int(so[q]), int(so[q+1])
l := e - s
if l <= 8 && w+8 <= end {
binary.LittleEndian.PutUint64(da[w:], binary.LittleEndian.Uint64(sa[s:]))
} else if l > 8 && l <= 16 {
binary.LittleEndian.PutUint64(da[w:], binary.LittleEndian.Uint64(sa[s:]))
binary.LittleEndian.PutUint64(da[w+l-8:], binary.LittleEndian.Uint64(sa[s+l-8:]))
} else {
copy(da[w:], sa[s:e])
}
w += l
do[r+1] = uint32(w)
}
})
}
return out
}
neo's side: the call and the contract
the sort's contract · neon-cpp/core/sort.h:1
// sort.h — stable O(n) sorting of row indices by a double key (parallel radix).
// JS numeric sort semantics: NaN sorts as -Infinity; ties keep input order.
// Fills `idx` with the stable ascending order of keys[0..n). pool may be null.
void sortIndexByDouble(const double* keys, size_t n, std::vector<uint32_t>& idx, Pool* pool);
Every number taken for it
measurement
neo
Go
× neo
time, msBest of three in one process, then the median over seven rounds, every engine run once a round in a shuffled order.
2.88
6.40
2.22×
Read it with this
Taken on a shared machine. Both columns ran in the same shuffled rounds, so the multiple stands, but the times themselves read high.
Total the amount column for each of five regions: a grouped sum, the kernel every dashboard runs.
How neo does it
The region column was dictionary-encoded at load, so its ids are the group numbers and no string is hashed. The sum is taken on the pool in any order only when the column is whole numbers small enough that no addition can round; otherwise it is added in row order on one thread, because a floating-point sum depends on its order, and the contract is the JavaScript loop's result to the bit.
How Go does it
Each chunk of rows adds into its own small array of group totals on the pool, and the chunks' totals are then added together in a fixed order.
sum by region · neon-cpp/bench/lang/go/main.go:1104
func aggregate(ids []uint32, amt []float64, groups int, p *pool) []float64 {
n := len(ids)
C := p.chunks()
partial := make([]float64, C*groups)
p.run(C, n, func(c, lo, hi int) {
acc := make([]float64, 4*groups)
a0, a1, a2, a3 := acc[:groups], acc[groups:2*groups], acc[2*groups:3*groups], acc[3*groups:]
i := lo
for ; i+4 <= hi; i += 4 {
a0[ids[i]] += amt[i]
a1[ids[i+1]] += amt[i+1]
a2[ids[i+2]] += amt[i+2]
a3[ids[i+3]] += amt[i+3]
}
for ; i < hi; i++ {
a0[ids[i]] += amt[i]
}
out := partial[c*groups : (c+1)*groups]
for g := 0; g < groups; g++ {
out[g] = a0[g] + a1[g] + a2[g] + a3[g]
}
})
sums := make([]float64, groups)
for c := 0; c < C; c++ {
for g := range sums {
sums[g] += partial[c*groups+g]
}
}
return sums
}
neo's side: the call and the contract
the harness, calling the engine · neon-cpp/bench/bench_engine_options.cpp:454
the group sum's contract · neon-cpp/core/groupsum.h:1
// groupsum.h — a typed column's sum, count and extremes per group: what the aggregate node's measures need
// once the column is doubles (toDoubles) and every row has a group number.
//
// The results are the ones a loop over the rows in order gives — `if (isFinite(v)) { sum += v; n++;
// if (v < min) min = v; if (v > max) max = v; }` a group, which is what the JavaScript does — to the bit:
// • counts and extremes are taken a part of the rows at a time on the pool and the parts joined in row
// order (a strict comparison keeps the earlier of two equal values, as the loop does);
// • a sum is added in row order on one thread, because a floating-point sum depends on its order —
// unless the column is whole numbers small enough that no addition can round (wholeNumbers below),
// where every order gives the same bits and the rows are summed on the pool, two a step.
// bench/bench_agg_node.cpp times each path against the node and checks it; PHD.md §30.
// The sum alone, any order, two rows a step; for tests and the benchmark (groupStats calls it when it may).
// False, and nothing written, when there are more groups than it is built for.
bool groupSumAnyOrder(const double* x, const uint32_t* id, size_t n, size_t groups, Pool* pool, double* sums);
Every number taken for it
measurement
neo
Go
× neo
time, msBest of three in one process, then the median over seven rounds, every engine run once a round in a shuffled order.
0.020
0.089
4.45×
Read it with this
Taken on a shared machine. Both columns ran in the same shuffled rounds, so the multiple stands, but the times themselves read high.
The kernels were ported to Go, Rust, Swift and Zig, each told to beat the C++; what they did better was then taken into the C++. Milliseconds, 1,000,000 rows. Where a port is still ahead, it is shown ahead. These are the million-row figures of the study in the next card, the same record: A round runs every engine once, in an order shuffled each round, and a figure is the median over the rounds (7 at 1,000,000 rows, 5 at 10,000,000 and 3 at 100,000,000). The load is one loop in every binary: three loads first, then three timed whole loads, the previous result still alive during each; its figure is the median over every timed load of every round. Filter, sort and sum are each binary's best of three in a process, and the figure the median of those. Threads: a port is run on 16 and 18 (every core) and its figure for a kernel is the better of the two; neo runs as it ships, on sixteen, and on every core for a load of 256 MB and more. Before a time is taken every engine prints its table as one number, an FNV over every cell, and after it its checks; the line under the table says whether they agreed. What still differs: a port is a benchmark kernel written for this comparison, not a library; each is built as its own run.sh builds it — the Rust and Zig ports for this processor, the Rust port with link-time optimisation, the Swift port with its checks off — and neo at -O3 with none of that; a port builds one dictionary where neo builds three; neo's filter figure is a bitmap where a port's is a list of row numbers; and the file is one synthetic shape (six columns, no field over sixteen bytes).
03 · The code that ran
Go's side, in full
Go is Google's statically typed, garbage-collected language, built for servers and tooling and for teams that want one obvious way to do things. The port runs on every core. The port was written to beat the C++ and given the C++ numbers to beat. Its code is beside each race above, and nothing of it is left out here.
neo's side: the calls and the contracts
neo's kernels are the product, so their bodies stay in the engine. What is published is what a reader needs to judge the comparison: the harness calling the engine, and each kernel's declaration with the guarantees it is held to, down to the order a floating-point sum is taken in. Each contract is beside its race above; the harness lines together, and whatever no race showed, are here. The binaries run on request, and the scripts named below reproduce every number on this page.
the harness, calling the engine · neon-cpp/bench/bench_engine_options.cpp
// energy.h — what a process has used, as the operating system's own ledger has it: the energy it was billed,
// its processor time, the wake-ups it caused. The one reader of that ledger, for two questions:
// what a kernel costs — the Evals page's Energy view (bench_engine_options.cpp reads it around each kernel;
// tools/energy/energy.cpp checks the counter and reads it for a command it runs;
// bench/lang/python/yardstick.py reads the same field; PHD.md section 33)
// what a process costs at rest — the idle studies (scripts/idle_cost.sh and scripts/idle_server.py take
// `neon_energy --pid <pid>` twice and subtract; PHD.md section 31.1)
//
// macOS on Apple silicon: proc_pid_rusage(RUSAGE_INFO_V6). ri_energy_nj — nanojoules billed to the process's
// threads for the processor cores they ran on, since it started. Not the memory, the disk or the screen, and
// not the machine at rest: what running this code added. (Not ri_billed_energy: against half a second of a
// busy loop that field read 0.08 mJ where ri_energy_nj read 1,887.) Beside it, processor time in nanoseconds
// — `ps` has hundredths of a second, more than a resting window uses in a minute — and the wake-ups. No
// privilege is needed, and any process of the same user can be read, so a tree of processes can be summed.
// Linux: /proc/<pid>/stat and /proc/<pid>/status — clock ticks and context switches. No energy: RAPL is one
// figure for the whole machine and root's to read.
// Elsewhere: nothing is read (ok stays false).
//
// A reading is cumulative; a measurement is the difference of two. The counter moves in steps (a thread's
// share is settled when it leaves a core or enters the kernel), so a window should be a quarter of a second
// or more: `neon_energy --check` prints how far apart the steps are on the machine it runs on.
04 · Diligence
What both sides were held to
Same input, same answer. Every engine reads the same file and prints the same checks line: the filter count, the first sorted values, the group sums. A number enters the ledger only when the checks agree with the C++.
Timed the same way. A kernel is the best of three in one process; a load is the engine's typed read, best of two, with the first read of a fresh process kept separately. Engines that need a warm-up get it before the clock.
Energy is what the machine billed. Millijoules a run, read from the hardware counters for each engine's whole process tree, with the draw at rest subtracted for the seconds of the window.
The machine is named, and so is its load. Apple M5 Max, 18 cores, 26.4.1. The load average before each run is in the ledger, and a study taken on a shared machine says so beside its numbers.
Where Go wins, it is shown winning. None of the 5 measurements on this page, and that is also a measurement.
The caveat on this comparison. The port was given the C++ numbers to beat, and what it did better was taken back into the C++. It runs on sixteen and eighteen threads, the better of the two. The study ran on a shared machine: every engine ran in the same shuffled rounds, so the columns stand beside each other, but the times themselves read high.
Scripts: scripts/scale_study.sh · measured 2026-10-12 · the numbers on this page come from the same ledger as the app's own Evals page, written by neon-cpp/scripts/results_md.py.