Gemini 4 Neon language bench
Times are the geometric mean of the language's median times over 90 tests, with the 9 data structures weighted equally.
Each data structure below was written by gemini-4-neon (effort high) from one prompt, once in every language, then tested and timed by the same harness. The ranking above combines all of them; pick a data structure to see every test, the generated code and how it was produced.
Data structures
B-treeIn-memory B-tree (minimum degree 16) mapping i64 keys to i64 values.10 tests on 4,000,000 entriesFastest: C, Rust, C++All results →Doubly linked listIn-memory doubly linked list of i64 values, one node per value, with constant-time insertion, removal and moves through node handles.10 tests on 3,000,000 entriesFastest: C, Zig, RustAll results →Hash mapIn-memory open-addressing hash map (linear probing, fixed hash, load factor 7/8) mapping i64 keys to i64 values.10 tests on 2,000,000 entriesFastest: C++, Rust, SwiftAll results →Binary heapIn-memory array-based binary min-heap (a priority queue) of entries with an i64 key and an i64 value.10 tests on 3,000,000 entriesFastest: C++, C, ZigAll results →Radix treeIn-memory radix tree (a path-compressed trie) mapping byte-string keys to i64 values, with longest-prefix match, prefix counts and ordered prefix listings.10 tests on 1,500,000 entriesFastest: C, Rust, ZigAll results →Red-black treeIn-memory red-black tree (one entry per node, balanced by recolouring and rotations) mapping i64 keys to i64 values.10 tests on 1,500,000 entriesFastest: Zig, Rust, CAll results →R-treeIn-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.10 tests on 400,000 entriesFastest: Zig, Swift, C++All results →Skip listIn-memory skip list (Pugh's randomized skip list: one node per entry with a tower of forward links of random height) mapping i64 keys to i64 values.10 tests on 1,250,000 entriesFastest: C++, Rust, C#All results →Union-findIn-memory disjoint-set forest (union-find) over the elements 0 .. n-1, with a union heuristic and path shortening.10 tests on 4,000,000 entriesFastest: Zig, C++, RustAll results →
Geometric mean time per data structure (ms)
| Data structure | C | C++ | Rust | Go | Zig | Swift | Java | C# | Node.js | Bun | Python |
|---|---|---|---|---|---|---|---|---|---|---|---|
| B-tree | 2291.00× | 2721.19× | 2601.13× | 3151.38× | 2801.22× | 2831.24× | 3501.53× | 2971.30× | 5762.52× | 5672.48× | 4,73020.66× |
| Doubly linked list | 1481.00× | 1601.08× | 1541.04× | 2061.39× | 1491.01× | 1551.05× | 2261.53× | 2021.36× | 3682.48× | 9126.16× | 5,77339.01× |
| Hash map | 1541.05× | 1471.00× | 1501.02× | 1931.32× | 1541.05× | 1511.03× | 1921.31× | 1701.16× | 5573.80× | 6354.33× | 3,77125.74× |
| Binary heap | 2211.04× | 2131.00× | 2331.09× | 3111.46× | 2291.08× | 2341.10× | 3691.73× | 3241.52× | 7923.72× | 7143.35× | 8,64840.57× |
| Radix tree | 2391.00× | 3151.32× | 2611.09× | 3451.44× | 2811.18× | 3381.41× | 3421.43× | 3371.41× | 5422.27× | 4912.06× | 3,04812.76× |
| Red-black tree | 3561.11× | 3661.14× | 3551.11× | 5061.57× | 3211.00× | 3711.15× | 4971.55× | 4741.48× | 6091.90× | 6752.10× | 4,47213.92× |
| R-tree | 1431.06× | 1381.02× | 1461.09× | 2041.52× | 1351.00× | 1381.02× | 2401.78× | 2371.76× | 3412.53× | 2591.92× | 6,60949.02× |
| Skip list | 5551.37× | 4041.00× | 5291.31× | 5311.32× | 5611.39× | 5651.40× | 5691.41× | 5301.31× | 6831.69× | 7091.76× | 4,33710.73× |
| Union-find | 1691.11× | 1621.06× | 1681.10× | 2781.81× | 1531.00× | 1711.12× | 2701.76× | 2431.59× | 3272.14× | 2931.92× | 8,42855.08× |
| All (geometric mean) | 2221.00× | 2241.01× | 2281.03× | 3011.36× | 2261.02× | 2391.08× | 3201.44× | 2931.32× | 5102.30× | 5442.45× | 5,23123.56× |
Ranking method
- Every test is timed more than once per language and the median is kept. A language's score on one data structure is the geometric mean of those medians over the data structure's tests.
- The time shown in the ranking is the geometric mean of the language's scores on all the data structures. Every data structure therefore counts the same, whatever its size and number of tests, and so does every test within it. Being twice as slow on any one test costs the same, wherever it is.
- The fastest language's ball crosses in one second; the others are slower in proportion to their time.
- A language is ranked only if it completed every test of every data structure.
- How the code is generated, checked and timed is described in the README.