Times are the geometric mean of the language's median times over the 10 tests.
In-memory open-addressing hash map (linear probing, fixed hash, load factor 7/8) mapping i64 keys to i64 values. 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 = 2,000,000
Samples 2 per cell (1 process × 2 timed repetitions, after 1 warm-up in each process)
Measured 2026-11-23 21:04 UTC-07:00
Machine Apple M3, 8 cores, 16 GB, macOS 27.0.1
Model was told 2,000,000 entries on Apple M3 (arm64), 16 GB (as measured)
Benchmark run time 8m 20s (C 0m 08s, C++ 0m 07s, Rust 0m 08s, Go 0m 09s, Zig 0m 08s, Swift 0m 08s, Java 0m 10s, C# 0m 09s, Node.js 0m 46s, Bun 0m 51s, Python 5m 36s)
Median time per case (ms)
Case
C
C++
Rust
Go
Zig
Swift
Java
C#
Node.js
Bun
Python
Insert, growing
1541.09×
1471.04×
1441.02×
1691.19×
1441.02×
1421.00×
1771.25×
1451.02×
5093.59×
4423.12×
4,12829.11×
Update
1101.00×
1311.19×
1231.11×
2021.83×
1141.03×
1151.05×
1571.42×
1341.21×
7376.68×
1,29211.71×
3,68233.36×
Get, present
1461.10×
1611.22×
1321.00×
2261.71×
1341.02×
1411.07×
1911.44×
1761.33×
1,1438.64×
1,76413.34×
5,45641.26×
Get, absent
1911.06×
1821.01×
1801.00×
2281.27×
1881.05×
1881.04×
2051.14×
1901.05×
5913.29×
6243.47×
2,57714.33×
Get, full table
1751.07×
1631.00×
1701.04×
1791.10×
1751.07×
1701.04×
1881.16×
1991.23×
4672.87×
2761.70×
2,37914.62×
Scan
1611.01×
1601.00×
1601.00×
2421.52×
2091.31×
1591.00×
2721.71×
2161.36×
8575.40×
5723.60×
16,515103.93×
Delete, half
1121.02×
1161.06×
1111.02×
1331.21×
1101.00×
1141.04×
1361.24×
1221.11×
2912.66×
4514.11×
2,32621.21×
Delete, all
1281.06×
1251.03×
1211.00×
1571.29×
1231.01×
1261.04×
1731.43×
1351.11×
3823.15×
6285.18×
3,00524.79×
Mixed, read-heavy
2961.74×
1701.00×
2991.76×
3141.84×
2971.75×
2901.71×
3472.04×
3081.81×
6503.82×
8655.08×
2,93117.23×
Churn, write-heavy
1311.07×
1261.03×
1221.00×
1441.18×
1241.01×
1271.04×
1481.22×
1411.16×
3933.22×
4393.59×
3,38227.71×
Overall (geometric mean)
1541.05×
1471.00×
1501.02×
1931.32×
1541.05×
1511.03×
1921.31×
1701.16×
5573.80×
6354.33×
3,77125.74×
Median time per case, log scale (ms)
Insert, growingUpdateGet, presentGet, absentGet, full tableScanDelete, halfDelete, allMixed, read-heavyChurn, write-heavy
2n inserts: twice, n new keys are inserted into an empty map, which grows from 16 slots by repeated doubling.
Update
6n inserts (6 passes over n random picks) that each replace the value of a key that is already present, on a map of n keys.
Get, present
8n lookups (8 passes over n random picks) of present keys, on a map of n keys.
Get, absent
4n lookups (4 passes over n keys) of absent keys, on a map of n keys.
Get, full table
n lookups, half of present and half of absent keys, on a map filled to just under the maximum load factor of 7/8.
Scan
80 full scans of a map of n keys, each copying out every entry.
Delete, half
2n removes: 4 rounds that each remove n/2 of the keys of a map of n keys. The keys are put back between rounds, untimed.
Delete, all
3n removes: 3 rounds that each remove all n keys in random order, leaving an empty map that must still be usable. The map is refilled between rounds, untimed.
Mixed, read-heavy
4n operations (4 passes over a stream of n) on a map of n keys: 70% get, 15% insert, 15% remove, over a domain of 2n keys.
Churn, write-heavy
4n operations (2 passes over a stream of 2n) on an initially empty map over a domain of n/4 keys, alternating growing phases (75% insert) and shrinking phases (75% remove), with 20% get.
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.