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: claude-opus-5-5_high
While writing these solutions the agents could run only the correctness tests (the same workloads at up to 100,000 entries, a few seconds per run). They could not run the timed workloads, time anything, or run any other program, so nothing here was tuned against the benchmark.
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 07:46 UTC-07:00
Machine Apple M3, 8 cores, 16 GB, macOS 27.0.1
Model was told 10,000,000 entries on Apple M4 Max (arm64), 36 GB (not what was measured)
Benchmark run time 10m 49s (C 0m 08s, C++ 0m 08s, Rust 0m 08s, Go 0m 12s, Zig 0m 08s, Swift 0m 08s, Java 0m 10s, C# 0m 09s, Node.js 0m 44s, Bun 0m 53s, Python 8m 02s)
Median time per case (ms)
Case
C
C++
Rust
Go
Zig
Swift
Java
C#
Node.js
Bun
Python
Insert, growing
1511.00×
1661.11×
1541.02×
1721.14×
1511.00×
1551.03×
1921.28×
1551.03×
3662.43×
4683.11×
4,85732.27×
Update
1371.19×
1161.01×
1151.00×
2091.82×
1231.07×
1231.07×
1651.44×
1451.26×
4684.07×
1,35611.81×
4,83142.06×
Get, present
1371.02×
1361.02×
1341.00×
2241.67×
1361.02×
1371.02×
2171.62×
1551.16×
7575.67×
1,74613.06×
6,91351.71×
Get, absent
1921.08×
1841.03×
1781.00×
2151.21×
1791.00×
1801.01×
2021.14×
1831.02×
3501.96×
6233.50×
3,13717.60×
Get, full table
1751.05×
1701.02×
1681.01×
1741.04×
1671.00×
1701.02×
1831.10×
1681.00×
2331.39×
2691.61×
4,83328.90×
Scan
1621.02×
1631.03×
1671.05×
9696.09×
2101.32×
1591.00×
2571.61×
2701.69×
1,70010.67×
1,2307.72×
47,901300.76×
Delete, half
1101.06×
1031.00×
1101.07×
1301.27×
1061.03×
1081.05×
1411.37×
1241.21×
2772.69×
4534.40×
2,30422.38×
Delete, all
1181.02×
1161.00×
1211.05×
1471.27×
1171.00×
1241.07×
2422.09×
1421.22×
3533.04×
6255.38×
2,84324.47×
Mixed, read-heavy
2981.05×
2841.00×
2981.05×
3281.15×
2931.03×
2931.03×
3371.19×
3021.06×
5702.01×
8533.00×
3,73713.15×
Churn, write-heavy
1291.01×
1291.02×
1291.01×
1521.19×
1311.03×
1271.00×
1501.18×
1421.12×
3292.59×
4483.53×
3,59328.28×
Overall (geometric mean)
1541.03×
1501.00×
1511.00×
2211.47×
1541.02×
1511.01×
2021.34×
1711.14×
4492.98×
6914.60×
5,03033.47×
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.