Clause

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.

Clause fasterOTP faster🔺 Runs varied by more than half of the median.
KernelOTP JITClause -O2Clause ÷ OTP
Data generation
bigint_factorialComputes the factorial of 3,000 with big integers, 330 times1,654.68198.040.12×
binary_appendAppends 10,000 32-bit integers to a growing binary, 23,000 times1,072.44806.260.75×
list_of_tuplesBuilds a list of 200,000 small tuples, 260 times1,444.86994.800.69×
list_to_tupleConverts 1,000-element lists to tuples, 170,000 times1,572.861,192.540.76×
map_putInserts 2,000 integer keys into a map one by one, 4,900 times1,579.931,505.780.95×
string_buildBuilds 20,000 strings from integers and atoms, 1,000 times1,026.76688.350.67×
Data processing
binary_matchSums 20,000 32-bit integers matched out of a binary, 49,000 times1,281.021,070.760.84×
comprehensionList comprehension filtering and doubling 20,000 integers, 15,000 times1,441.38675.830.47×
int_to_listConverts 20,000 integers to strings and back, 2,000 times1,244.57406.750.33×
map_foldlMaps, then folds a list of 20,000 integers, 4,500 times1,492.68633.900.42×
map_updateIncrements every value of a 500-key map, 24,000 times1,318.20657.110.50×
small_mapUpdates a small state map 80 million times1,462.17876.650.60×
sortSorts a list of 20,000 random integers, 600 times1,077.15454.150.42×
term_to_binaryEncodes and decodes a large nested term, 4,300 times1,235.661,089.470.88×
Distribution
data_exchange200 round trips of a 64 KB binary and 1,000 tuples with a peer node, 3 times125.34345.972.76×
ping_pong5,000 message round trips with a peer node over TCP, 3 times616.041,089.471.77×
reconnect20 disconnects and reconnects to a peer node, each with a round trip, 3 times129.5478.740.61×
spawnSpawns 500 processes on a peer node one after another, 3 times65.23149.222.29×
Distribution over TLS
data_exchange200 round trips of a 64 KB binary and 1,000 tuples between two nodes over TLS, 3 times292.862,388.568.16×
ping_pong5,000 message round trips between two nodes over TLS, 3 times790.122,032.512.57×
reconnect20 disconnects and reconnects between two nodes over TLS, each with a round trip, 3 times273.72403.621.47×
spawnSpawns 500 processes on a peer node over TLS, one after another, 3 times82.74279.633.38×
File I/O
large_readReads a 16 MB file in 64 KB chunks, 370 times1,269.35873.390.69×
large_writeWrites a 16 MB file in 64 KB chunks, 200 times864.56892.061.03×
read_fileReads a whole 16 MB file in one call, 330 times1,369.911,370.401.00×
read_lineReads a 20,000-line text file line by line, 52 times1,502.921,411.750.94×
small_filesWrites, reads back and deletes 500 small files, 11 times854.22672.610.79×
Floating point
callsTrapezoid sum of a polynomial, one call per step, 160 times1,221.22484.610.40×
guardsAn is_float/1 guard in a 1-million-step float loop, 120 times1,177.70432.630.37×
limitGrows a float step by step past 1e100, 80 times1,171.25258.060.22×
mandelbrotMandelbrot escape counts over a 120×120 grid, 120 times1,203.00247.690.21×
negateUnary minus and float/1 in a 1-million-step float loop, 70 times1,231.67634.610.52×
sumSums a float over a 1-million-step loop, 200 times1,119.85472.120.42×
Garbage collection
explicit_collectForces garbage collection with 10,000 live tuples, 5,100 times1,563.24633.330.41×
grow_shrinkGrows the heap with a 200,000-element list, then drops it, 300 times1,029.53823.350.80×
long_lived_churnKeeps a sliding window of 10,000 live elements among garbage, 370 times1,297.721,088.160.84×
short_processesSpawns 5,000 short-lived processes that each make garbage, 69 times1,482.34967.460.65×
Libraries
qlcRuns the qlc transform over 27 queries and 3 modules, 11 times1,830.501,354.140.74×
Message passing
fan_in100 processes each send 1,000 messages to one, 25 times1,386.19255.670.18×
large_messageSends a 100,000-element list to another process and back, 560 times1,096.60803.160.73×
ping_pongBounces one message between two processes 2 million times1,482.75843.090.57×
ringPasses a token around a 1,000-process ring 3,050 times1,416.501,020.770.72×
Runtime slow paths
dictionary_atom_keys500,000 rounds of puts and gets on four process dictionary atom keys, 3 times51.9288.321.70×
dictionary_tuple_keysPuts, gets and erases 2,000 tuple keys in the process dictionary, 3 times1.131.451.29×
ets_insert_orderedInserts 100,000 in-order objects into a new ordered_set table, 5 times56.3290.241.60×
ets_insert_setInserts 100,000 objects into a new set table, 5 times89.40135.971.52×
ets_insert_shuffledInserts 100,000 shuffled objects into a new ordered_set table, 5 times75.78166.152.19×
ets_interleavedFive bulk ETS operations on 100,000 objects while two processes exchange messages, 3 times344.78490.721.42×
ets_tab2listCopies a 100,000-object set table to a list, 5 times25.9145.701.76×
list_length1,000 length calls on a 78,000-element list, 3 times287.44273.390.95×
list_mergeMerges two sorted 39,000-element lists, 20 times16.799.780.58×
list_split1,000 splits of 1,000 elements off a 78,000-element list, 3 times26.429.270.35×
map_put_get_3078,000 map reads and updates cycling through 30 atom keys, 3 times14.857.220.49×
map_update_with_3078,000 maps:update_with calls cycling through 30 atom keys, 3 times14.9512.850.86×
map_update_with_878,000 maps:update_with calls cycling through 8 atom keys, 3 times5.7311.411.99×
raise_catchRaises and catches an error every other step of 500,000, 3 times48.0336.260.75×
unicode_categoryReads the Unicode category of about 78,000 code points, 3 times3.485.551.59×
unicode_nfcNormalizes about 78,000 code points to NFC one by one, 3 times7.3719.802.69×
unicode_nfdNormalizes about 78,000 code points to NFD one by one, 3 times7.0720.022.83×
unicode_nfkcNormalizes about 78,000 code points to NFKC one by one, 3 times7.9923.622.96×
unicode_nfkdNormalizes about 78,000 code points to NFKD one by one, 3 times7.3719.482.64×
unicode_propertyChecks whitespace and identifier properties of about 78,000 code points, 3 times4.714.520.96×
Loopback sockets
tcp_connectOpens 900 TCP connections over loopback, echoing 25 messages of 1 KB on each1,324.651,014.640.77×
tcp_echoEchoes 30,000 messages of 1 KB over loopback TCP1,330.181,105.950.83×
udp_round_tripBounces a 1 KB datagram 27,900 times over loopback UDP1,330.591,172.830.88×
TLS
tls_bulk 🔺Sends 1,024 chunks of 16 KB over loopback TLS 1.3, 3 times110.28127.381.16×
tls_echo5,000 TLS 1.3 echo round trips of 1 KB over loopback, 3 times884.741,543.301.74×
tls_handshake50 TLS 1.3 connections, each a full handshake and one echo, 3 times293.99534.881.82×

Whole programs

Wall time in seconds, startup included, median of the runs.

ProgramOTP JITClause -O2Clause ÷ OTP
bench_datagenBuilds lists, tuples, maps, binaries and big integers in bulk8.535.420.64×
bench_dataprocSorting, folds, map updates, binary matching and conversions10.645.900.55×
bench_distRound trips, data, remote spawns and reconnects between nodes, over TCP and TLS4.8312.312.55×
bench_fileSmall and large file writes and reads, line reads6.145.480.89×
bench_floatFloat loops: sums, Mandelbrot, limits, negation, guards and calls7.332.570.35×
bench_gcShort-lived processes, heap growth and shrinking, live data churn5.513.570.65×
bench_libraryThe qlc parse transform at run time, as qlc:q/1 uses it2.221.490.67×
bench_msgPing-pong, fan-in, a process ring and large message copies5.652.980.53×
bench_pathsETS bulk operations, map updates, raise and catch, the process dictionary, unicode forms and list operations1.621.971.22×
bench_socketTCP echo, TCP connects and UDP round trips over loopback5.464.420.81×
bench_sslTLS 1.3 echo, handshakes and bulk transfer over loopback2.052.981.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.

DateCommitClause ÷ OTP
2026-10-12a7bc0c9b20.2×
2026-10-138a244d9c16.9×
2026-10-1455f42a9d16.9×
2026-10-156ed3851c2.73×
2026-10-1697295c841.95×
2026-10-17a8c3f8f61.38×
2026-10-18336caea71.41×
2026-10-207d7a2f2e1.00×
2026-10-2171ec52f80.78×
2026-10-23dea685080.69×
2026-10-24af1050430.65×
2026-10-26d6eafa720.71×
2026-10-30f4e5f3e00.67×
2026-11-013265232a0.67×
2026-11-2316c2ac620.89×

Executable sizes

Size of the benchmark programs as Clause builds them at each optimization level, in megabytes.

Program-O0-O2-O2 --lto
bench_datagen10.26 MB10.18 MB10.18 MB
bench_dataproc10.78 MB10.37 MB10.37 MB
bench_dist45.81 MB27.61 MB27.62 MB
bench_file11.86 MB11.08 MB11.09 MB
bench_float10.34 MB10.21 MB10.21 MB
bench_gc10.25 MB10.17 MB10.17 MB
bench_library10.60 MB10.30 MB10.31 MB
bench_msg10.27 MB10.18 MB10.18 MB
bench_paths10.46 MB10.26 MB10.26 MB
bench_socket12.11 MB11.13 MB11.15 MB
bench_ssl45.41 MB27.46 MB27.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.

0246810121416182022242628 MBbench_datagen, 2026-10-23 dea68508: 6.33 MBbench_datagen, 2026-10-24 af105043: 6.33 MBbench_datagen, 2026-10-26 d6eafa72: 8.55 MBbench_datagen, 2026-10-30 f4e5f3e0: 9.82 MBbench_datagen, 2026-11-01 3265232a: 10.14 MBbench_datagen, 2026-11-23 16c2ac62: 10.18 MB10.18bench_datagenbench_dataproc, 2026-10-23 dea68508: 6.65 MBbench_dataproc, 2026-10-24 af105043: 6.65 MBbench_dataproc, 2026-10-26 d6eafa72: 8.74 MBbench_dataproc, 2026-10-30 f4e5f3e0: 10.01 MBbench_dataproc, 2026-11-01 3265232a: 10.33 MBbench_dataproc, 2026-11-23 16c2ac62: 10.37 MB10.37bench_dataprocbench_dist, 2026-11-01 3265232a: 24.51 MBbench_dist, 2026-11-23 16c2ac62: 27.61 MB27.61bench_distbench_file, 2026-10-23 dea68508: 6.75 MBbench_file, 2026-10-24 af105043: 6.75 MBbench_file, 2026-10-26 d6eafa72: 9.20 MBbench_file, 2026-10-30 f4e5f3e0: 10.59 MBbench_file, 2026-11-01 3265232a: 18.09 MBbench_file, 2026-11-23 16c2ac62: 11.08 MB11.08bench_filebench_float, 2026-11-01 3265232a: 10.17 MBbench_float, 2026-11-23 16c2ac62: 10.21 MB10.21bench_floatbench_gc, 2026-10-23 dea68508: 6.32 MBbench_gc, 2026-10-24 af105043: 6.32 MBbench_gc, 2026-10-26 d6eafa72: 8.54 MBbench_gc, 2026-10-30 f4e5f3e0: 9.81 MBbench_gc, 2026-11-01 3265232a: 10.13 MBbench_gc, 2026-11-23 16c2ac62: 10.17 MB10.17bench_gcbench_library, 2026-10-26 d6eafa72: 9.30 MBbench_library, 2026-10-30 f4e5f3e0: 9.94 MBbench_library, 2026-11-01 3265232a: 10.26 MBbench_library, 2026-11-23 16c2ac62: 10.30 MB10.30bench_librarybench_msg, 2026-10-23 dea68508: 6.33 MBbench_msg, 2026-10-24 af105043: 6.33 MBbench_msg, 2026-10-26 d6eafa72: 8.55 MBbench_msg, 2026-10-30 f4e5f3e0: 9.82 MBbench_msg, 2026-11-01 3265232a: 10.14 MBbench_msg, 2026-11-23 16c2ac62: 10.18 MB10.18bench_msgbench_paths, 2026-11-23 16c2ac62: 10.26 MB10.26bench_pathsbench_socket, 2026-10-23 dea68508: 6.43 MBbench_socket, 2026-10-24 af105043: 6.43 MBbench_socket, 2026-10-26 d6eafa72: 9.33 MBbench_socket, 2026-10-30 f4e5f3e0: 10.64 MBbench_socket, 2026-11-01 3265232a: 18.13 MBbench_socket, 2026-11-23 16c2ac62: 11.13 MB11.13bench_socketbench_ssl, 2026-11-01 3265232a: 26.76 MBbench_ssl, 2026-11-23 16c2ac62: 27.46 MB27.46bench_ssl
  • 2026-10-23dea68508
  • 2026-10-24af105043
  • 2026-10-26d6eafa72
  • 2026-10-30f4e5f3e0
  • 2026-11-013265232a
  • 2026-11-2316c2ac62
DateCommitAll bench_* programsclau
2026-10-23dea6850838.79 MB59.54 MB
2026-10-24af10504338.81 MB59.65 MB
2026-10-26d6eafa7262.21 MB59.98 MB
2026-10-30f4e5f3e070.63 MB60.75 MB
2026-11-013265232a148.67 MB60.82 MB
2026-11-2316c2ac62148.95 MB60.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