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.60× faster on average
Geometric mean of library test times, OTP library modules compiled by Clause -O2 against the BEAM JIT (OTP)
1.39× slower on average
Kernels where Clause is faster
38 / 44

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,110.12207.560.19×
binary_appendAppends 10,000 32-bit integers to a growing binary, 23,000 times1,076.22803.840.75×
list_of_tuplesBuilds a list of 200,000 small tuples, 260 times1,473.951,121.960.76×
list_to_tupleConverts 1,000-element lists to tuples, 170,000 times1,500.471,191.700.79×
map_putInserts 2,000 integer keys into a map one by one, 4,900 times1,576.241,478.730.94×
string_buildBuilds 20,000 strings from integers and atoms, 1,000 times1,031.48772.520.75×
Data processing
binary_matchSums 20,000 32-bit integers matched out of a binary, 49,000 times1,274.781,076.120.84×
comprehensionList comprehension filtering and doubling 20,000 integers, 15,000 times1,418.04664.730.47×
int_to_listConverts 20,000 integers to strings and back, 2,000 times899.69410.860.46×
map_foldlMaps, then folds a list of 20,000 integers, 4,500 times1,459.92616.890.42×
map_updateIncrements every value of a 500-key map, 24,000 times1,188.35648.980.55×
small_mapUpdates a small state map 80 million times1,484.291,027.860.69×
sortSorts a list of 20,000 random integers, 600 times1,038.95454.890.44×
term_to_binaryEncodes and decodes a large nested term, 4,300 times1,427.561,060.320.74×
Distribution
data_exchange200 round trips of a 64 KB binary and 1,000 tuples with a peer node, 3 times148.07426.422.88×
ping_pong5,000 message round trips with a peer node over TCP, 3 times831.181,239.781.49×
reconnect20 disconnects and reconnects to a peer node, each with a round trip, 3 times137.1166.420.48×
spawnSpawns 500 processes on a peer node one after another, 3 times91.03166.031.82×
File I/O
large_readReads a 16 MB file in 64 KB chunks, 370 times1,416.091,029.620.73×
large_writeWrites a 16 MB file in 64 KB chunks, 200 times975.05922.760.95×
read_fileReads a whole 16 MB file in one call, 330 times1,488.381,418.650.95×
read_lineReads a 20,000-line text file line by line, 52 times1,507.641,385.170.92×
small_filesWrites, reads back and deletes 500 small files, 11 times1,256.451,143.670.91×
Floating point
callsTrapezoid sum of a polynomial, one call per step, 160 times1,227.88487.210.40×
guardsAn is_float/1 guard in a 1-million-step float loop, 120 times1,173.50433.070.37×
limitGrows a float step by step past 1e100, 80 times1,167.16257.380.22×
mandelbrotMandelbrot escape counts over a 120×120 grid, 120 times1,251.12249.260.20×
negateUnary minus and float/1 in a 1-million-step float loop, 70 times1,222.35633.830.52×
sumSums a float over a 1-million-step loop, 200 times1,115.14472.370.42×
Garbage collection
explicit_collectForces garbage collection with 10,000 live tuples, 5,100 times1,524.12580.090.38×
grow_shrinkGrows the heap with a 200,000-element list, then drops it, 300 times1,052.06849.050.81×
long_lived_churnKeeps a sliding window of 10,000 live elements among garbage, 370 times1,308.671,088.480.83×
short_processesSpawns 5,000 short-lived processes that each make garbage, 69 times1,652.531,026.000.62×
Libraries
qlcRuns the qlc transform over 27 queries and 3 modules, 11 times1,858.461,685.380.91×
Message passing
fan_in100 processes each send 1,000 messages to one, 25 times1,374.31277.800.20×
large_messageSends a 100,000-element list to another process and back, 560 times1,075.30780.680.73×
ping_pongBounces one message between two processes 2 million times1,494.43810.770.54×
ringPasses a token around a 1,000-process ring 3,050 times1,435.961,028.150.72×
Loopback sockets
tcp_connectOpens 900 TCP connections over loopback, echoing 25 messages of 1 KB on each1,487.161,152.300.77×
tcp_echoEchoes 30,000 messages of 1 KB over loopback TCP1,574.401,274.580.81×
udp_round_tripBounces a 1 KB datagram 27,900 times over loopback UDP1,504.671,234.780.82×
TLS
tls_bulkSends 1,024 chunks of 16 KB over loopback TLS 1.3, 3 times139.37145.921.05×
tls_echo5,000 TLS 1.3 echo round trips of 1 KB over loopback, 3 times1,018.572,052.422.01×
tls_handshake50 TLS 1.3 connections, each a full handshake and one echo, 3 times324.40636.091.96×

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 bulk7.915.610.71×
bench_dataprocSorting, folds, map updates, binary matching and conversions10.295.970.58×
bench_distRound trips, data, remote spawns and reconnects between nodes; OTP also runs them over TLS5.674.780.84×
bench_fileSmall and large file writes and reads, line reads6.966.080.87×
bench_floatFloat loops: sums, Mandelbrot, limits, negation, guards and calls7.362.570.35×
bench_gcShort-lived processes, heap growth and shrinking, live data churn5.793.600.62×
bench_libraryThe qlc parse transform at run time, as qlc:q/1 uses it2.231.860.83×
bench_msgPing-pong, fan-in, a process ring and large message copies5.633.000.53×
bench_socketTCP echo, TCP connects and UDP round trips over loopback6.264.920.79×
bench_sslTLS 1.3 echo, handshakes and bulk transfer over loopback2.213.871.75×

Progress

Geometric mean of Clause's time divided by OTP's on each recorded run day. 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×

Executable sizes

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

Program-O0-O2-O2 --lto
bench_datagen10.22 MB10.14 MB10.14 MB
bench_dataproc10.74 MB10.33 MB10.33 MB
bench_dist39.41 MB24.51 MB24.52 MB
bench_file30.25 MB18.09 MB18.07 MB
bench_float10.30 MB10.17 MB10.17 MB
bench_gc10.21 MB10.13 MB10.14 MB
bench_library10.56 MB10.26 MB10.27 MB
bench_msg10.23 MB10.14 MB10.14 MB
bench_socket30.33 MB18.13 MB18.10 MB
bench_ssl43.62 MB26.76 MB26.76 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-21 71ec52f8: 6.32 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 MB10.14bench_datagenbench_dataproc, 2026-10-21 71ec52f8: 6.64 MBbench_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 MB10.33bench_dataprocbench_dist, 2026-11-01 3265232a: 24.51 MB24.51bench_distbench_file, 2026-10-21 71ec52f8: 6.75 MBbench_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 MB18.09bench_filebench_float, 2026-11-01 3265232a: 10.17 MB10.17bench_floatbench_gc, 2026-10-21 71ec52f8: 6.32 MBbench_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 MB10.13bench_gcbench_library, 2026-10-26 d6eafa72: 9.30 MBbench_library, 2026-10-30 f4e5f3e0: 9.94 MBbench_library, 2026-11-01 3265232a: 10.26 MB10.26bench_librarybench_msg, 2026-10-21 71ec52f8: 6.32 MBbench_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 MB10.14bench_msgbench_socket, 2026-10-21 71ec52f8: 6.42 MBbench_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 MB18.13bench_socketbench_ssl, 2026-11-01 3265232a: 26.76 MB26.76bench_ssl
  • 2026-10-2171ec52f8
  • 2026-10-23dea68508
  • 2026-10-24af105043
  • 2026-10-26d6eafa72
  • 2026-10-30f4e5f3e0
  • 2026-11-013265232a
DateCommitAll bench_* programsclau
2026-10-2171ec52f838.78 MB59.54 MB
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

Setup

Machine
Intel64 Family 6 Model 183 Stepping 1, GenuineIntel, 32 logical CPUs, Windows 11 (10.0.26200)
CPU set
Performance cores 0-15, 16 of 32 logical CPUs
Erlang/OTP
29, ERTS 17.1
Clause commit
3265232a
Run
2026-11-01

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