Benchmarks
Clause compared with Erlang/OTP on one machine: the same Erlang programs, compiled by erlc and by clau -O2, time their kernels after a warm-up call. These numbers change with every optimization.
- Geometric mean of kernel times of the compiled programs, library tests left out, Clause -O2 against the BEAM JIT (OTP)
- 1.14× faster on average
- Geometric mean of library test times, OTP library modules compiled by Clause -O2 against the BEAM JIT (OTP)
- 1.28× slower on average
- Kernels where Clause is faster
- 43 / 68
Kernel times
Median of 3 runs in milliseconds. The bar shows Clause's time divided by OTP's on a logarithmic scale.
| Kernel | OTP JIT | Clause -O2 | Clause ÷ OTP | |
|---|---|---|---|---|
| Data generation | ||||
| bigint_factorialComputes the factorial of 3,000 with big integers, 330 times | 1,654.68 | 198.04 | 0.12× | |
| binary_appendAppends 10,000 32-bit integers to a growing binary, 23,000 times | 1,072.44 | 806.26 | 0.75× | |
| list_of_tuplesBuilds a list of 200,000 small tuples, 260 times | 1,444.86 | 994.80 | 0.69× | |
| list_to_tupleConverts 1,000-element lists to tuples, 170,000 times | 1,572.86 | 1,192.54 | 0.76× | |
| map_putInserts 2,000 integer keys into a map one by one, 4,900 times | 1,579.93 | 1,505.78 | 0.95× | |
| string_buildBuilds 20,000 strings from integers and atoms, 1,000 times | 1,026.76 | 688.35 | 0.67× | |
| Data processing | ||||
| binary_matchSums 20,000 32-bit integers matched out of a binary, 49,000 times | 1,281.02 | 1,070.76 | 0.84× | |
| comprehensionList comprehension filtering and doubling 20,000 integers, 15,000 times | 1,441.38 | 675.83 | 0.47× | |
| int_to_listConverts 20,000 integers to strings and back, 2,000 times | 1,244.57 | 406.75 | 0.33× | |
| map_foldlMaps, then folds a list of 20,000 integers, 4,500 times | 1,492.68 | 633.90 | 0.42× | |
| map_updateIncrements every value of a 500-key map, 24,000 times | 1,318.20 | 657.11 | 0.50× | |
| small_mapUpdates a small state map 80 million times | 1,462.17 | 876.65 | 0.60× | |
| sortSorts a list of 20,000 random integers, 600 times | 1,077.15 | 454.15 | 0.42× | |
| term_to_binaryEncodes and decodes a large nested term, 4,300 times | 1,235.66 | 1,089.47 | 0.88× | |
| Distribution | ||||
| data_exchange200 round trips of a 64 KB binary and 1,000 tuples with a peer node, 3 times | 125.34 | 345.97 | 2.76× | |
| ping_pong5,000 message round trips with a peer node over TCP, 3 times | 616.04 | 1,089.47 | 1.77× | |
| reconnect20 disconnects and reconnects to a peer node, each with a round trip, 3 times | 129.54 | 78.74 | 0.61× | |
| spawnSpawns 500 processes on a peer node one after another, 3 times | 65.23 | 149.22 | 2.29× | |
| Distribution over TLS | ||||
| data_exchange200 round trips of a 64 KB binary and 1,000 tuples between two nodes over TLS, 3 times | 292.86 | 2,388.56 | 8.16× | |
| ping_pong5,000 message round trips between two nodes over TLS, 3 times | 790.12 | 2,032.51 | 2.57× | |
| reconnect20 disconnects and reconnects between two nodes over TLS, each with a round trip, 3 times | 273.72 | 403.62 | 1.47× | |
| spawnSpawns 500 processes on a peer node over TLS, one after another, 3 times | 82.74 | 279.63 | 3.38× | |
| File I/O | ||||
| large_readReads a 16 MB file in 64 KB chunks, 370 times | 1,269.35 | 873.39 | 0.69× | |
| large_writeWrites a 16 MB file in 64 KB chunks, 200 times | 864.56 | 892.06 | 1.03× | |
| read_fileReads a whole 16 MB file in one call, 330 times | 1,369.91 | 1,370.40 | 1.00× | |
| read_lineReads a 20,000-line text file line by line, 52 times | 1,502.92 | 1,411.75 | 0.94× | |
| small_filesWrites, reads back and deletes 500 small files, 11 times | 854.22 | 672.61 | 0.79× | |
| Floating point | ||||
| callsTrapezoid sum of a polynomial, one call per step, 160 times | 1,221.22 | 484.61 | 0.40× | |
| guardsAn is_float/1 guard in a 1-million-step float loop, 120 times | 1,177.70 | 432.63 | 0.37× | |
| limitGrows a float step by step past 1e100, 80 times | 1,171.25 | 258.06 | 0.22× | |
| mandelbrotMandelbrot escape counts over a 120×120 grid, 120 times | 1,203.00 | 247.69 | 0.21× | |
| negateUnary minus and float/1 in a 1-million-step float loop, 70 times | 1,231.67 | 634.61 | 0.52× | |
| sumSums a float over a 1-million-step loop, 200 times | 1,119.85 | 472.12 | 0.42× | |
| Garbage collection | ||||
| explicit_collectForces garbage collection with 10,000 live tuples, 5,100 times | 1,563.24 | 633.33 | 0.41× | |
| grow_shrinkGrows the heap with a 200,000-element list, then drops it, 300 times | 1,029.53 | 823.35 | 0.80× | |
| long_lived_churnKeeps a sliding window of 10,000 live elements among garbage, 370 times | 1,297.72 | 1,088.16 | 0.84× | |
| short_processesSpawns 5,000 short-lived processes that each make garbage, 69 times | 1,482.34 | 967.46 | 0.65× | |
| Libraries | ||||
| qlcRuns the qlc transform over 27 queries and 3 modules, 11 times | 1,830.50 | 1,354.14 | 0.74× | |
| Message passing | ||||
| fan_in100 processes each send 1,000 messages to one, 25 times | 1,386.19 | 255.67 | 0.18× | |
| large_messageSends a 100,000-element list to another process and back, 560 times | 1,096.60 | 803.16 | 0.73× | |
| ping_pongBounces one message between two processes 2 million times | 1,482.75 | 843.09 | 0.57× | |
| ringPasses a token around a 1,000-process ring 3,050 times | 1,416.50 | 1,020.77 | 0.72× | |
| Runtime slow paths | ||||
| dictionary_atom_keys500,000 rounds of puts and gets on four process dictionary atom keys, 3 times | 51.92 | 88.32 | 1.70× | |
| dictionary_tuple_keysPuts, gets and erases 2,000 tuple keys in the process dictionary, 3 times | 1.13 | 1.45 | 1.29× | |
| ets_insert_orderedInserts 100,000 in-order objects into a new ordered_set table, 5 times | 56.32 | 90.24 | 1.60× | |
| ets_insert_setInserts 100,000 objects into a new set table, 5 times | 89.40 | 135.97 | 1.52× | |
| ets_insert_shuffledInserts 100,000 shuffled objects into a new ordered_set table, 5 times | 75.78 | 166.15 | 2.19× | |
| ets_interleavedFive bulk ETS operations on 100,000 objects while two processes exchange messages, 3 times | 344.78 | 490.72 | 1.42× | |
| ets_tab2listCopies a 100,000-object set table to a list, 5 times | 25.91 | 45.70 | 1.76× | |
| list_length1,000 length calls on a 78,000-element list, 3 times | 287.44 | 273.39 | 0.95× | |
| list_mergeMerges two sorted 39,000-element lists, 20 times | 16.79 | 9.78 | 0.58× | |
| list_split1,000 splits of 1,000 elements off a 78,000-element list, 3 times | 26.42 | 9.27 | 0.35× | |
| map_put_get_3078,000 map reads and updates cycling through 30 atom keys, 3 times | 14.85 | 7.22 | 0.49× | |
| map_update_with_3078,000 maps:update_with calls cycling through 30 atom keys, 3 times | 14.95 | 12.85 | 0.86× | |
| map_update_with_878,000 maps:update_with calls cycling through 8 atom keys, 3 times | 5.73 | 11.41 | 1.99× | |
| raise_catchRaises and catches an error every other step of 500,000, 3 times | 48.03 | 36.26 | 0.75× | |
| unicode_categoryReads the Unicode category of about 78,000 code points, 3 times | 3.48 | 5.55 | 1.59× | |
| unicode_nfcNormalizes about 78,000 code points to NFC one by one, 3 times | 7.37 | 19.80 | 2.69× | |
| unicode_nfdNormalizes about 78,000 code points to NFD one by one, 3 times | 7.07 | 20.02 | 2.83× | |
| unicode_nfkcNormalizes about 78,000 code points to NFKC one by one, 3 times | 7.99 | 23.62 | 2.96× | |
| unicode_nfkdNormalizes about 78,000 code points to NFKD one by one, 3 times | 7.37 | 19.48 | 2.64× | |
| unicode_propertyChecks whitespace and identifier properties of about 78,000 code points, 3 times | 4.71 | 4.52 | 0.96× | |
| Loopback sockets | ||||
| tcp_connectOpens 900 TCP connections over loopback, echoing 25 messages of 1 KB on each | 1,324.65 | 1,014.64 | 0.77× | |
| tcp_echoEchoes 30,000 messages of 1 KB over loopback TCP | 1,330.18 | 1,105.95 | 0.83× | |
| udp_round_tripBounces a 1 KB datagram 27,900 times over loopback UDP | 1,330.59 | 1,172.83 | 0.88× | |
| TLS | ||||
| tls_bulk 🔺Sends 1,024 chunks of 16 KB over loopback TLS 1.3, 3 times | 110.28 | 127.38 | 1.16× | |
| tls_echo5,000 TLS 1.3 echo round trips of 1 KB over loopback, 3 times | 884.74 | 1,543.30 | 1.74× | |
| tls_handshake50 TLS 1.3 connections, each a full handshake and one echo, 3 times | 293.99 | 534.88 | 1.82× | |
Whole programs
Wall time in seconds, startup included, median of the runs.
| Program | OTP JIT | Clause -O2 | Clause ÷ OTP | |
|---|---|---|---|---|
| bench_datagenBuilds lists, tuples, maps, binaries and big integers in bulk | 8.53 | 5.42 | 0.64× | |
| bench_dataprocSorting, folds, map updates, binary matching and conversions | 10.64 | 5.90 | 0.55× | |
| bench_distRound trips, data, remote spawns and reconnects between nodes, over TCP and TLS | 4.83 | 12.31 | 2.55× | |
| bench_fileSmall and large file writes and reads, line reads | 6.14 | 5.48 | 0.89× | |
| bench_floatFloat loops: sums, Mandelbrot, limits, negation, guards and calls | 7.33 | 2.57 | 0.35× | |
| bench_gcShort-lived processes, heap growth and shrinking, live data churn | 5.51 | 3.57 | 0.65× | |
| bench_libraryThe qlc parse transform at run time, as qlc:q/1 uses it | 2.22 | 1.49 | 0.67× | |
| bench_msgPing-pong, fan-in, a process ring and large message copies | 5.65 | 2.98 | 0.53× | |
| bench_pathsETS bulk operations, map updates, raise and catch, the process dictionary, unicode forms and list operations | 1.62 | 1.97 | 1.22× | |
| bench_socketTCP echo, TCP connects and UDP round trips over loopback | 5.46 | 4.42 | 0.81× | |
| bench_sslTLS 1.3 echo, handshakes and bulk transfer over loopback | 2.05 | 2.98 | 1.45× |
Progress
Geometric mean of Clause's time divided by OTP's on each recorded run day. Kernels count from the first run that measures them, so a change can come from new kernels as well as from speed. Runs before 2026-10-21 were not pinned to a CPU set, so part of the change on that day comes from the pinning.
| Date | Commit | Clause ÷ OTP |
|---|---|---|
| 2026-10-12 | a7bc0c9b | 20.2× |
| 2026-10-13 | 8a244d9c | 16.9× |
| 2026-10-14 | 55f42a9d | 16.9× |
| 2026-10-15 | 6ed3851c | 2.73× |
| 2026-10-16 | 97295c84 | 1.95× |
| 2026-10-17 | a8c3f8f6 | 1.38× |
| 2026-10-18 | 336caea7 | 1.41× |
| 2026-10-20 | 7d7a2f2e | 1.00× |
| 2026-10-21 | 71ec52f8 | 0.78× |
| 2026-10-23 | dea68508 | 0.69× |
| 2026-10-24 | af105043 | 0.65× |
| 2026-10-26 | d6eafa72 | 0.71× |
| 2026-10-30 | f4e5f3e0 | 0.67× |
| 2026-11-01 | 3265232a | 0.67× |
| 2026-11-23 | 16c2ac62 | 0.89× |
Executable sizes
Size of the benchmark programs as Clause builds them at each optimization level, in megabytes.
| Program | -O0 | -O2 | -O2 --lto |
|---|---|---|---|
| bench_datagen | 10.26 MB | 10.18 MB | 10.18 MB |
| bench_dataproc | 10.78 MB | 10.37 MB | 10.37 MB |
| bench_dist | 45.81 MB | 27.61 MB | 27.62 MB |
| bench_file | 11.86 MB | 11.08 MB | 11.09 MB |
| bench_float | 10.34 MB | 10.21 MB | 10.21 MB |
| bench_gc | 10.25 MB | 10.17 MB | 10.17 MB |
| bench_library | 10.60 MB | 10.30 MB | 10.31 MB |
| bench_msg | 10.27 MB | 10.18 MB | 10.18 MB |
| bench_paths | 10.46 MB | 10.26 MB | 10.26 MB |
| bench_socket | 12.11 MB | 11.13 MB | 11.15 MB |
| bench_ssl | 45.41 MB | 27.46 MB | 27.47 MB |
-O2 sizes of the last 6 benchmark runs, oldest first, one Clause commit each. The table below adds the total of all bench_* programs and the size of the clau compiler.
- 2026-10-23dea68508
- 2026-10-24af105043
- 2026-10-26d6eafa72
- 2026-10-30f4e5f3e0
- 2026-11-013265232a
- 2026-11-2316c2ac62
| Date | Commit | All bench_* programs | clau |
|---|---|---|---|
| 2026-10-23 | dea68508 | 38.79 MB | 59.54 MB |
| 2026-10-24 | af105043 | 38.81 MB | 59.65 MB |
| 2026-10-26 | d6eafa72 | 62.21 MB | 59.98 MB |
| 2026-10-30 | f4e5f3e0 | 70.63 MB | 60.75 MB |
| 2026-11-01 | 3265232a | 148.67 MB | 60.82 MB |
| 2026-11-23 | 16c2ac62 | 148.95 MB | 60.88 MB |
Setup
- Machine
- Intel64 Family 6 Model 183 Stepping 1, GenuineIntel, 32 logical CPUs, Windows 11 (10.0.26300)
- CPU set
- Performance cores 0-15, 16 of 32 logical CPUs
- Erlang/OTP
- 29, ERTS 17.1
- Clause commit
- 16c2ac62
- Run
- 2026-11-23
OTP and Clause run on the same CPUs: every benchmark program is pinned to the performance cores of the processor, so on a hybrid CPU no kernel lands on a slower efficiency core. Both keep one scheduler online per CPU of that set, unbound within it.
To run the benchmarks yourself, use make benchmark or make-benchmark.bat in the Clause repository; the benchmark notes describe the programs and options. Benchmark notes
Clause