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: gemini-4-neon_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 22:10 UTC-07:00
Machine Apple M3, 8 cores, 16 GB, macOS 27.0.1
Model was told 400,000 entries on Apple M3 (arm64), 16 GB (as measured)
Benchmark run time 8m 16s (C 0m 08s, C++ 0m 07s, Rust 0m 07s, Go 0m 10s, Zig 0m 07s, Swift 0m 07s, Java 0m 14s, C# 0m 14s, Node.js 0m 36s, Bun 0m 27s, Python 5m 59s)
Median time per case (ms)
Case
C
C++
Rust
Go
Zig
Swift
Java
C#
Node.js
Bun
Python
Insert, random
67.71.00×
69.21.02×
71.11.05×
97.01.44×
68.71.02×
67.61.00×
1432.12×
2123.13×
2794.14×
2303.40×
3,73355.25×
Insert, sorted
69.31.04×
66.91.00×
73.71.10×
84.01.26×
67.61.01×
68.91.03×
1161.74×
1742.61×
2223.31×
1922.87×
4,05360.62×
Search, small windows
2201.12×
2051.04×
2361.20×
3411.73×
2121.07×
1971.00×
4612.34×
2571.30×
4142.10×
2931.49×
10,35152.48×
Search, large windows
1111.00×
1201.08×
1221.10×
1731.56×
1231.11×
1151.03×
2141.92×
1771.59×
2302.07×
2001.80×
8,61577.40×
Search, empty space
2711.41×
2201.14×
2741.42×
3621.88×
2131.11×
1921.00×
3151.64×
2101.09×
4902.55×
2671.39×
8,87246.10×
Point queries
1361.04×
1421.09×
1721.32×
2231.71×
1411.08×
1311.00×
2291.76×
1651.26×
3252.49×
1961.50×
7,44156.99×
Nearest 8
2021.32×
1711.12×
1611.05×
2381.56×
1531.00×
1991.30×
3062.00×
3902.56×
4713.09×
3562.33×
7,45148.78×
Remove all
1161.00×
1171.01×
1221.05×
1861.61×
1191.03×
1301.12×
1941.68×
1971.70×
2482.14×
2091.80×
4,58339.60×
Moving objects
2011.00×
2031.01×
2101.05×
3091.54×
2011.00×
2081.04×
3241.61×
4032.01×
5152.57×
4412.20×
9,13445.51×
Mixed
1761.18×
1741.17×
1541.03×
2371.59×
1491.00×
1751.17×
2771.86×
3072.06×
3802.55×
3062.05×
5,72038.40×
Overall (geometric mean)
1431.06×
1381.02×
1461.09×
2041.52×
1351.00×
1381.02×
2401.78×
2371.76×
3412.53×
2591.92×
6,60949.02×
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.