Times are the geometric mean of the language's median times over the 10 tests.
In-memory Guttman R-tree (quadratic split, at most 16 and at least 6 entries per node) over two-dimensional integer rectangles with integer ids, answering window, point and nearest-neighbour queries. Every implementation on this page was written by an AI model from the same prompt, then tested and timed by the same harness.
Results: claude-opus-5-5_high
Entries n = 400,000
Samples 2 per cell (1 process × 2 timed repetitions, after 1 warm-up in each process)
Measured 2026-11-23 08:58 UTC-07:00
Machine Apple M3, 8 cores, 16 GB, macOS 27.0.1
Model was told 1,000,000 entries on Apple M4 Max (arm64), 36 GB (not what was measured)
Benchmark run time 10m 02s (C 0m 09s, C++ 0m 08s, Rust 0m 08s, Go 0m 13s, Zig 0m 08s, Swift 0m 37s, Java 0m 17s, C# 0m 16s, Node.js 0m 41s, Bun 0m 31s, Python 6m 54s)
Median time per case (ms)
Case
C
C++
Rust
Go
Zig
Swift
Java
C#
Node.js
Bun
Python
Insert, random
1011.23×
92.31.12×
92.71.13×
1141.39×
82.31.00×
1021.24×
1601.94×
2192.66×
3223.91×
2623.18×
5,02661.06×
Insert, sorted
84.61.07×
79.41.00×
86.81.09×
97.81.23×
84.21.06×
84.81.07×
1251.57×
1752.21×
2393.01×
2062.59×
4,35954.91×
Search, small windows
1921.08×
2041.15×
2161.21×
5593.13×
1781.00×
2,14512.03×
6883.86×
2821.58×
6783.80×
5503.08×
9,43552.89×
Search, large windows
1121.00×
1151.02×
1411.26×
2191.95×
1151.02×
8287.39×
2302.05×
2342.09×
3062.73×
2332.08×
9,96888.96×
Search, empty space
2451.23×
2771.39×
2801.40×
5032.53×
1991.00×
2,63513.23×
4852.43×
2051.03×
5922.97×
4662.34×
7,66738.50×
Point queries
1501.12×
1631.22×
1671.25×
4063.04×
1331.00×
1,77213.27×
5303.97×
1921.44×
5173.88×
4063.04×
6,38847.86×
Nearest 8
1931.00×
2441.26×
2191.14×
2781.44×
2161.12×
2391.24×
3952.05×
4142.15×
5252.72×
4392.28×
9,74350.55×
Remove all
1621.17×
1471.07×
1581.15×
2241.63×
1381.00×
9166.65×
2762.01×
2011.46×
3572.59×
3082.24×
5,88642.76×
Moving objects
2751.26×
2381.09×
2531.16×
3731.71×
2181.00×
1,2185.58×
4562.09×
4261.95×
6943.18×
5882.70×
11,69253.62×
Mixed
1701.00×
1941.15×
1811.07×
3181.88×
1761.04×
9425.56×
3361.98×
2981.76×
5002.95×
3972.34×
6,38237.65×
Overall (geometric mean)
1581.09×
1631.12×
1681.16×
2701.85×
1461.00×
6694.60×
3262.24×
2531.73×
4473.07×
3642.50×
7,30450.14×
Median time per case, log scale (ms)
Insert, randomInsert, sortedSearch, small windowsSearch, large windowsSearch, empty spacePoint queriesNearest 8Remove allMoving objectsMixed
3n inserts: 3 times, a tree is built by inserting n rectangles one at a time, in random spatial order.
Insert, sorted
4n inserts: 4 times, a tree is built by inserting the same n rectangles in Z-order of their centres, as data from a spatially sorted source arrives.
Search, small windows
n window queries on a tree of n rectangles, each window sized to match about 10 of them.
Search, large windows
n/16 window queries on a tree of n rectangles, each window sized to match about 1000 of them.
Search, empty space
2n window queries on a tree of n rectangles, each inside an empty area surrounded by data, so it matches nothing but overlaps the bounding rectangles of nearby nodes.
Point queries
n stabbing queries on a tree of n rectangles: which rectangles contain a point, for a point inside a random rectangle.
Nearest 8
n/4 queries for the 8 rectangles nearest to a point, in order of distance, on a tree of n rectangles.
Remove all
n removals that empty a tree of n rectangles, in random order, condensing the tree as it shrinks.
Moving objects
n steps on a tree of n rectangles, each removing a random rectangle and inserting it again up to 1024 units from where it was (2n operations).
Mixed
2n operations on a small tree of n/16 rectangles that stays in the CPU caches: 40% small-window searches, 20% point queries, 15% nearest with k = 1, 5% nearest with k = 8, 10% inserts, 10% removes.
Method
Each language has a benchmark-owned driver (a line-for-line port of one canonical driver, in lang/) that calls the model-written data structure. The model does not write or control any timing code.
The driver times only the loop of operations, with an in-process monotonic clock. Process and runtime start-up, workload generation, pre-populating the structure, and verification are outside the timed region.
Every process runs a discarded warm-up repetition first (which is when a JIT compiles the hot code), then the timed repetitions, each on a freshly built structure. The number of processes and repetitions is the same for every language. Garbage-collected runtimes get one explicit collection before the timer starts; collections during the timed loop are counted.
Every repetition's results are checked against a reference, so a time is only reported for a correct run.
A language's overall score is the geometric mean of its median times over all cases. Unlike a total, that gives every case the same weight however long it runs, and being twice as slow on any one case costs the same. A language is only ranked if it completed every case.
All languages are compiled with fixed optimising flags and run single-threaded; see the README for the exact commands.