Skip to content

Latest commit

 

History

History
375 lines (313 loc) · 28.8 KB

benchmarks.md

File metadata and controls

375 lines (313 loc) · 28.8 KB

Benchmarks: AIL against C, Rust, Go and Python

This page is generated by tools/bench/publish.sh; do not edit it by hand. The commands below reproduce every number. Ratios below 1 mean AIL is faster (or smaller) than the other column.

Environment

  • date: 2026-11-20
  • AIL commit: 3d0c5c913 (ail 0.2.0 (agentbench-e13-591-g3d0c5c913, native))
  • host: Linux x86_64, 4 logical cores, Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz
  • gcc: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
  • clang: Ubuntu clang version 18.1.3 (1ubuntu1)
  • rustc: rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
  • go: go version go1.22.2 linux/amd64
  • python: Python 3.12.3
  • OS: Linux 6.8.0-147-generic
  • AIL build: ail build FILE -o EXE with AIL_BUILD_ARGS=""; AIL runs with AIL_THREADS unset, AIL 1T with AIL_THREADS=1
  • C flags: gcc -O2 -ffp-contract=off -lm, clang -O2 -ffp-contract=off -lm
  • Rust flags: rustc -C opt-level=3 --edition 2021 (no target-cpu); Go: go build (default flags); Python: python3 -I
  • load at start: 1.17, 1.10, 1.03; nothing else running, no CPU affinity set
  • runs per cell: 5 (wall seconds; tables report the median, the spread tables the min–max)

Method

  • Each program exists five times with the same algorithm and byte-identical output (tools/perfbench/programs/NAME.{ail,c,rs,go,py}; the larger C-class programs in tools/perfbench/big/ have no Python twin). A column whose output differs from the reference is reported as DIFF and left out.
  • AIL is ail build FILE -o EXE (native code, run directly). C is gcc -O2 and clang -O2 with -ffp-contract=off, so floats match. Rust is rustc -C opt-level=3 on safe, idiomatic code (bounds-checked indexing, std::collections::HashMap in wordfreq), ported line for line from the C twin; like the C columns it has no target-cpu flag. Go is go build with its default flags, also ported from the C twin (including wordfreq's hand-written FNV-1a hash map). Python is CPython 3 (python3 -I), no numpy.
  • The C, Rust, Go and Python twins are single-threaded. AIL's native code runs loops the compiler proves independent on all cores by default, past a work threshold, with results identical to running them in order (ADR 0911). So every AIL row is timed twice: AIL with the default thread count and AIL 1T with AIL_THREADS=1, the like-for-like column against the single-threaded twins. A row marked ‡ ran on several cores (its 1T time is more than 15% longer). The AIL / X columns use the default run and AIL 1T / X the single thread.
  • Wall time of the whole process, the median of the runs shown, on a machine with nothing else running; the spread (min–max) of the same runs is under the tables, so a row whose runs differ widely is visible. No best-of selection. The tables above are the host in the environment block; any other hosts follow, each with its own environment (OS, CPU, compiler versions and the exact flags of every column). Each environment block names the commit that host ran. Runs under 0.3 s are within noise of about 10% (tools/perfbench/README.md).
  • Honest sizes (drag.size.1): publish.sh starts from the size in NAME.args and doubles it (adds one for fannkuch and binarytrees) until gcc -O2 takes at least 0.3 s, so no row sits in the noise band. The size column shows the size every language ran; the reference output is gcc's at that size. The larger programs in tools/perfbench/big/ already run for seconds.

Reproduce (needs gcc, clang, rustc, go and python3; Debian/Ubuntu also python3-venv):

tools/bench/publish.sh                       # everything on this page
python3 -I tools/perfbench/race.py --no-run --native --c --rust --go --python --programs tools/perfbench/programs/nbody.ail

Speed: the ten small programs

program size AIL AIL 1T gcc -O2 clang -O2 Rust Go Python AIL / gcc AIL 1T / gcc AIL / Rust AIL / Go AIL / Python
collatz ‡ 1600000 0.172 0.371 0.443 0.246 0.454 0.477 20.930 0.39 0.84 0.38 0.36 0.01
nbody 6400000 0.555 0.553 0.526 0.543 0.526 0.827 54.899 1.05 1.05 1.05 0.67 0.01
spectralnorm ‡ 4000 0.323 0.872 0.949 0.855 1.014 1.184 206.428 0.34 0.92 0.32 0.27 0.00
mandelbrot 1920 0.156 0.153 0.434 0.425 0.429 0.468 16.262 0.36 0.35 0.36 0.33 0.01
fannkuch 11 3.175 3.277 2.980 3.423 3.576 2.991 112.594 1.07 1.10 0.89 1.06 0.03
binarytrees 18 0.385 0.386 0.306 0.318 0.407 0.359 15.694 1.26 1.26 0.94 1.07 0.02
fasta 32000000 0.223 0.207 0.345 0.305 0.302 0.462 10.906 0.65 0.60 0.74 0.48 0.02
wordfreq 32000000 0.433 0.433 0.497 0.707 1.635 0.769 8.042 0.87 0.87 0.26 0.56 0.05
matmul ‡ 800 0.116 1.345 0.767 0.721 1.200 1.245 43.686 0.15 1.75 0.10 0.09 0.00
sieve 48000000 0.448 0.444 0.443 0.412 0.410 0.425 10.002 1.01 1.00 1.09 1.05 0.04

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Speed: larger programs (AIL against C, Rust and Go)

program size AIL AIL 1T gcc -O2 clang -O2 Rust Go AIL / gcc AIL 1T / gcc AIL / Rust AIL / Go
lzr 12000000 2.847 2.848 2.272 2.389 2.764 2.674 1.25 1.25 1.03 1.06
vm 700000 1.926 1.925 1.686 1.371 2.409 1.954 1.14 1.14 0.80 0.99
raytrace 4000 1.674 1.675 1.800 1.516 1.807 2.024 0.93 0.93 0.93 0.83
matmul1400 ‡ 1400 0.607 19.172 8.182 7.962 9.478 9.507 0.07 2.34 0.06 0.06

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Speed: text and allocation programs

program what it does AIL AIL 1T gcc -O2 AIL / gcc AIL 1T / gcc
readline read 5 million lines with io.read_line 0.190 0.189 0.212 0.90 0.89
fields read 5 million lines, split each on a space, parse the second field 1.051 1.048 1.117 0.94 0.94
splitline split one 5-word line 3 million times 0.132 0.350 0.341 0.39 1.03
floatparse parse 50 million float strings with to_float 1.246 1.240 5.423 0.23 0.23
charat 20 MB string, 25 passes of s.char_at(i) 0.689 0.688 0.189 3.64 3.63
charwalk 20 MB string, 25 passes of for c in s.chars() 0.688 0.691 0.406 1.70 1.70
gcchurn 30 million short-lived strings with 500 thousand live ones 1.532 1.854 2.329 0.66 0.80
gcints 20 million short-lived strings beside a 50-million-element list 1.536 1.858 1.771 0.87 1.05

Sizes are fixed in tools/perfbench/text/NAME.ail (each runs about a second); readline and fields read a generated five-million-line input on stdin. The C twins are single-threaded and AIL auto-parallelizes, so read the AIL 1T columns for a like-for-like comparison. floatparse prints the same sum as its C twin in different float text, and the harness compares the two as numbers.

Spread of the runs

Min–max wall seconds of the runs behind each median above.

program AIL AIL 1T gcc -O2 clang -O2 Rust Go Python
collatz 0.169–0.186 0.370–0.372 0.439–0.443 0.243–0.247 0.453–0.455 0.475–0.478 20.916–21.058
nbody 0.553–0.556 0.550–0.556 0.526–0.529 0.541–0.545 0.515–0.528 0.824–0.832 54.757–55.127
spectralnorm 0.314–0.324 0.865–0.874 0.947–0.951 0.851–0.858 1.010–1.017 1.179–1.189 202.421–207.541
mandelbrot 0.152–0.160 0.152–0.157 0.433–0.436 0.424–0.430 0.427–0.432 0.467–0.473 16.202–16.477
fannkuch 3.166–3.189 3.168–3.316 2.967–2.985 3.418–3.430 3.569–3.581 2.985–3.003 111.851–113.383
binarytrees 0.383–0.389 0.384–0.392 0.305–0.309 0.316–0.374 0.405–0.414 0.358–0.364 15.649–15.886
fasta 0.207–0.227 0.206–0.225 0.342–0.360 0.289–0.305 0.300–0.318 0.459–0.480 10.883–10.925
wordfreq 0.430–0.435 0.432–0.433 0.495–0.499 0.705–0.708 1.622–1.675 0.769–0.773 7.848–8.199
matmul 0.108–0.121 1.280–1.359 0.756–0.772 0.703–0.747 1.196–1.230 1.224–1.267 42.937–43.927
sieve 0.439–0.454 0.432–0.452 0.438–0.453 0.404–0.417 0.407–0.417 0.422–0.433 9.974–10.039

Larger programs:

program AIL AIL 1T gcc -O2 clang -O2 Rust Go
lzr 2.833–2.856 2.839–2.856 2.259–2.275 2.370–2.392 2.755–2.771 2.655–2.683
vm 1.926–1.927 1.917–1.929 1.682–1.694 1.365–1.375 2.399–2.411 1.947–1.958
raytrace 1.672–1.683 1.669–1.690 1.795–1.812 1.509–1.521 1.800–1.808 2.012–2.030
matmul1400 0.601–0.621 18.537–20.479 7.837–8.387 7.516–8.346 8.906–9.854 9.417–9.754

Speed on the other hosts

The same command on each host, with the same calibration rule; every size is that host's own. Commits: Darwin arm64 3d0c5c913; Windows x86_64 349b95d42.

Darwin arm64

  • date: 2026-11-21
  • AIL commit: 3d0c5c913 (ail 0.2.0 (agentbench-e13-591-g3d0c5c913, native))
  • host: Darwin arm64, 8 logical cores, Apple M2
  • gcc: Apple clang version 21.0.0 (clang-2100.4.1.1)
  • clang: Apple clang version 21.0.0 (clang-2100.4.1.1)
  • rustc: rustc 1.98.1 (48a229cea 2026-09-01)
  • go: go version go1.27.4 darwin/arm64
  • python: Python 3.14.4
  • OS: Darwin 27.0.0
  • AIL build: ail build FILE -o EXE with AIL_BUILD_ARGS=""; AIL runs with AIL_THREADS unset, AIL 1T with AIL_THREADS=1
  • C flags: gcc -O2 -ffp-contract=off -lm, clang -O2 -ffp-contract=off -lm
  • Rust flags: rustc -C opt-level=3 --edition 2021 (no target-cpu); Go: go build (default flags); Python: python3 -I
  • load at start: 4.69 4.23 3.55; nothing else running, no CPU affinity set
  • runs per cell: 5 (wall seconds; tables report the median, the spread tables the min–max)

gcc on this host is Apple clang, so the C column is that one compiler (run as gcc -O2, the calibration reference).

Small programs:

program size AIL AIL 1T clang -O2 Rust Go Python AIL / clang AIL 1T / clang AIL / Rust AIL / Go AIL / Python
collatz ‡ 3200000 0.125 0.465 0.469 0.470 0.619 23.226 0.27 0.99 0.27 0.20 0.01
nbody 12800000 0.513 0.514 0.502 0.334 0.576 55.862 1.02 1.02 1.54 0.89 0.01
spectralnorm ‡ 4000 0.116 0.570 0.576 0.581 0.761 76.060 0.20 0.99 0.20 0.15 0.00
mandelbrot 3840 0.399 0.400 0.968 0.989 0.951 43.348 0.41 0.41 0.40 0.42 0.01
fannkuch 11 2.040 2.038 2.013 1.787 2.053 55.014 1.01 1.01 1.14 0.99 0.04
binarytrees 19 0.422 0.422 0.390 0.425 0.421 13.469 1.08 1.08 0.99 1.00 0.03
fasta 64000000 0.269 0.269 0.459 0.394 0.839 8.460 0.59 0.59 0.68 0.32 0.03
wordfreq 32000000 0.118 0.115 0.474 0.851 0.404 3.372 0.25 0.24 0.14 0.29 0.04
matmul ‡ 800 0.058 0.454 0.330 0.358 0.491 17.947 0.17 1.37 0.16 0.12 0.00
sieve 96000000 0.440 0.433 0.373 0.395 0.430 9.357 1.18 1.16 1.11 1.02 0.05

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Larger programs:

program size AIL AIL 1T clang -O2 Rust Go AIL / clang AIL 1T / clang AIL / Rust AIL / Go
lzr 12000000 1.331 1.324 1.102 1.360 1.447 1.21 1.20 0.98 0.92
vm 700000 0.969 0.966 1.160 1.216 1.178 0.84 0.83 0.80 0.82
raytrace 4000 0.841 0.842 0.955 0.839 0.981 0.88 0.88 1.00 0.86
matmul1400 ‡ 1400 0.343 4.650 1.312 1.941 4.020 0.26 3.55 0.18 0.09

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Text and allocation programs:

program what it does AIL AIL 1T clang -O2 AIL / clang AIL 1T / clang
readline read 5 million lines with io.read_line 0.089 0.089 0.196 0.46 0.45
fields read 5 million lines, split each on a space, parse the second field 0.452 0.450 0.498 0.91 0.90
splitline split one 5-word line 3 million times 0.061 0.158 0.126 0.49 1.26
floatparse parse 50 million float strings with to_float 0.735 0.736 0.723 1.02 1.02
charat 20 MB string, 25 passes of s.char_at(i) 0.376 0.375 0.085 4.41 4.39
charwalk 20 MB string, 25 passes of for c in s.chars() 0.316 0.319 0.196 1.61 1.62
gcchurn 30 million short-lived strings with 500 thousand live ones 0.460 0.774 1.702 0.27 0.45
gcints 20 million short-lived strings beside a 50-million-element list 0.466 0.676 1.158 0.40 0.58

Spread (min–max wall seconds of the runs behind each median):

program AIL AIL 1T gcc -O2 clang -O2 Rust Go Python
collatz 0.123–0.138 0.461–0.470 0.465–0.472 0.466–0.471 0.468–0.471 0.613–0.628 23.127–23.409
nbody 0.511–0.517 0.513–0.514 0.500–0.502 0.500–0.502 0.332–0.337 0.571–0.579 55.798–55.919
spectralnorm 0.116–0.125 0.570–0.579 0.573–0.581 0.575–0.577 0.581–0.591 0.758–0.762 74.507–77.345
mandelbrot 0.396–0.401 0.397–0.401 0.964–0.969 0.964–0.970 0.985–0.993 0.946–0.954 43.242–43.503
fannkuch 2.036–2.044 2.038–2.040 2.007–2.050 2.045–2.055 1.781–1.792 2.042–2.148 54.903–55.155
binarytrees 0.422–0.425 0.422–0.425 0.389–0.392 0.388–0.392 0.422–0.426 0.420–0.424 13.453–13.527
fasta 0.265–0.270 0.268–0.272 0.457–0.460 0.459–0.462 0.380–0.418 0.832–0.852 8.440–8.508
wordfreq 0.114–0.122 0.114–0.117 0.472–0.484 0.473–0.478 0.848–0.851 0.401–0.406 3.257–3.505
matmul 0.056–0.061 0.450–0.457 0.328–0.334 0.329–0.336 0.353–0.364 0.488–0.495 17.819–19.282
sieve 0.420–0.463 0.418–0.449 0.366–0.391 0.366–0.429 0.387–0.421 0.423–0.462 9.323–9.857
program AIL AIL 1T gcc -O2 clang -O2 Rust Go
lzr 1.316–1.347 1.320–1.377 1.101–1.105 1.096–1.104 1.311–1.489 1.427–1.465
vm 0.966–0.980 0.963–0.971 1.157–1.161 1.156–1.162 1.213–1.257 1.176–1.179
raytrace 0.840–0.842 0.841–0.843 0.912–0.966 0.906–0.920 0.838–0.842 0.977–0.985
matmul1400 0.324–0.361 4.640–4.759 1.300–1.415 1.291–1.319 1.925–2.037 4.005–4.140

Windows x86_64

  • date: 2026-11-21
  • AIL commit: 349b95d42 (ail 0.2.0 (v0.2.0-10-g349b95d42, native))
  • host: Windows x86_64, 4 logical cores, Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz
  • gcc: gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders, r3) 16.2.0
  • clang: (built by Brecht Sanders, r3) clang version 23.1.3
  • rustc: rustc 1.100.0 (0ef1bc386 2026-11-09)
  • go: go version go1.27.4 windows/amd64
  • python: Python 3.12.10
  • OS: MINGW64_NT-10.0-26200 3.6.10-5a1665c8.x86_64
  • AIL build: ail build FILE -o EXE with AIL_BUILD_ARGS=""; AIL runs with AIL_THREADS unset, AIL 1T with AIL_THREADS=1
  • C flags: gcc -O2 -ffp-contract=off -lm, clang -O2 -ffp-contract=off -lm
  • Rust flags: rustc -C opt-level=3 --edition 2021 (no target-cpu); Go: go build (default flags); Python: python3 -I
  • load at start: ; nothing else running, no CPU affinity set
  • runs per cell: 5 (wall seconds; tables report the median, the spread tables the min–max)

Small programs:

program size AIL AIL 1T gcc -O2 clang -O2 Rust Go Python AIL / gcc AIL 1T / gcc AIL / Rust AIL / Go AIL / Python
collatz 1600000 0.417 0.380 0.320 0.247 0.246 0.492 26.521 1.30 1.19 1.69 0.85 0.02
nbody 6400000 0.558 0.559 0.542 0.550 0.330 0.773 73.336 1.03 1.03 1.69 0.72 0.01
spectralnorm 4000 0.878 0.874 0.856 0.858 1.087 1.205 222.631 1.03 1.02 0.81 0.73 0.00
mandelbrot 1920 0.182 0.181 0.470 0.475 0.462 0.500 20.417 0.39 0.38 0.40 0.37 0.01
fannkuch 11 3.307 3.303 2.664 2.968 2.847 3.058 158.395 1.24 1.24 1.16 1.08 0.02
binarytrees 19 0.758 0.757 0.526 0.686 0.750 0.743 39.665 1.44 1.44 1.01 1.02 0.02
fasta 32000000 0.328 0.318 0.512 0.497 0.376 0.585 13.825 0.64 0.62 0.87 0.56 0.02
wordfreq 32000000 0.438 0.437 0.547 0.744 1.531 0.779 8.703 0.80 0.80 0.29 0.56 0.05
matmul ‡ 800 0.208 1.278 0.770 0.741 0.930 1.107 50.217 0.27 1.66 0.22 0.19 0.00
sieve 48000000 0.501 0.498 0.498 0.478 0.463 0.489 13.410 1.01 1.00 1.08 1.02 0.04

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Larger programs:

program size AIL AIL 1T gcc -O2 clang -O2 Rust Go AIL / gcc AIL 1T / gcc AIL / Rust AIL / Go
lzr 12000000 2.684 2.694 2.285 2.357 2.784 2.498 1.17 1.18 0.96 1.07
vm 700000 1.924 1.922 2.125 1.398 1.495 2.085 0.91 0.90 1.29 0.92
raytrace 4000 1.672 1.671 1.847 1.570 1.549 1.986 0.91 0.90 1.08 0.84
matmul1400 ‡ 1400 0.925 20.084 8.149 8.204 9.158 9.970 0.11 2.46 0.10 0.09

‡ This row ran on several cores: with AIL_THREADS=1 it is more than 15% slower. Read it against the AIL 1T column, since the C, Rust, Go and Python twins are single-threaded.

Text and allocation programs:

program what it does AIL AIL 1T gcc -O2 AIL / gcc AIL 1T / gcc
readline read 5 million lines with io.read_line 0.235 0.249 1.213 0.19 0.21
fields read 5 million lines, split each on a space, parse the second field 1.171 1.157 2.357 0.50 0.49
splitline split one 5-word line 3 million times 0.414 0.514 0.456 0.91 1.13
floatparse parse 50 million float strings with to_float 1.209 1.221 6.300 0.19 0.19
charat 20 MB string, 25 passes of s.char_at(i) 0.686 0.683 0.270 2.54 2.53
charwalk 20 MB string, 25 passes of for c in s.chars() 0.700 0.680 0.402 1.74 1.69
gcchurn 30 million short-lived strings with 500 thousand live ones 1.881 2.431 4.243 0.44 0.57
gcints 20 million short-lived strings beside a 50-million-element list 1.618 2.023 2.940 0.55 0.69

Spread (min–max wall seconds of the runs behind each median):

program AIL AIL 1T gcc -O2 clang -O2 Rust Go Python
collatz 0.394–0.479 0.370–0.385 0.319–0.408 0.241–0.289 0.240–0.251 0.489–0.610 26.367–26.572
nbody 0.556–0.562 0.558–0.561 0.541–0.582 0.550–0.608 0.329–0.336 0.771–0.950 72.922–73.718
spectralnorm 0.861–0.883 0.868–0.876 0.853–0.895 0.855–0.879 1.084–1.094 1.204–1.276 220.170–224.066
mandelbrot 0.179–0.217 0.178–0.181 0.469–0.502 0.468–0.527 0.457–0.465 0.497–0.562 20.405–20.467
fannkuch 3.295–3.310 3.298–3.309 2.649–2.756 2.961–3.029 2.845–2.850 3.048–3.134 158.152–159.172
binarytrees 0.757–0.782 0.755–0.759 0.524–0.580 0.679–0.710 0.749–0.752 0.706–1.335 39.470–39.754
fasta 0.313–0.379 0.315–0.320 0.509–0.569 0.493–0.555 0.373–0.383 0.577–0.667 13.663–14.059
wordfreq 0.435–0.445 0.435–0.438 0.542–0.604 0.740–0.788 1.531–1.550 0.775–0.828 8.663–8.743
matmul 0.192–0.240 1.258–1.282 0.721–0.782 0.701–0.796 0.920–0.961 1.100–1.240 50.058–50.343
sieve 0.500–0.523 0.496–0.499 0.493–0.531 0.473–0.499 0.462–0.469 0.483–0.622 13.319–13.489
program AIL AIL 1T gcc -O2 clang -O2 Rust Go
lzr 2.675–2.881 2.683–2.725 2.281–2.314 2.288–2.412 2.781–2.796 2.490–2.538
vm 1.918–2.011 1.918–1.924 2.103–2.153 1.396–1.432 1.491–1.497 2.083–2.142
raytrace 1.666–1.674 1.665–1.674 1.841–1.900 1.565–1.625 1.546–1.564 1.983–2.045
matmul1400 0.860–0.941 14.753–20.196 7.652–8.235 7.685–8.664 8.209–9.392 9.099–10.432

Known gaps

Programs whose AIL / gcc ratio is 1.10 or more on at least one host (rows whose C column ran under 0.3 s are left out; on macOS the C compiler is Apple clang). The twins are single-threaded and AIL auto-parallelizes, so a row that ran on several cores also shows its AIL_THREADS=1 ratio. The causes are recorded by hand in design/benchmark-gaps.md; the list of programs and ratios is computed from the tables above.

  • binarytrees: Linux x86_64 1.26; Windows x86_64 1.44. Cause: not yet analysed for 0.2.0; allocation and collection are the measured work, and no profile was taken at this release.
  • lzr: Linux x86_64 1.25; Darwin arm64 1.21; Windows x86_64 1.17. Cause: the register allocator and the remaining bounds-check work; the gap is spread across the program rather than in one loop (analysis from 0.1.0; not repeated for 0.2.0).
  • vm: Linux x86_64 1.14. Cause: not yet analysed for 0.2.0; no profile was taken at this release.
  • charwalk: Linux x86_64 1.70; Windows x86_64 1.74. Cause: on x86-64 a guarded if c == X: total += 1 costs about 12 instructions because the select runs as a branch diamond; the string read itself is not the main cost (ADR 1162). charat has the same cause and is the larger gap (AIL / gcc 3.6 on Linux and 4.4 on the Mac at the 0.2.0 candidate), but its C twin runs under 0.3 s at the fixed size, so the generated list leaves it out as noise-band; the ratio is far outside the noise.
  • sieve: Darwin arm64 1.18. Cause: macOS only (1.18 against clang); not yet analysed for 0.2.0.
  • collatz: Windows x86_64 1.30. Cause: not yet analysed past 0.2.0; one thread is 1.19 against gcc, the integer loop itself. 0.2.0 on Windows ran it 18 times slower with default threads (392 short parallel regions, each costing about 28 ms because Windows waiters poll on timer ticks; the conc.par.19 fallback was skipped for heavy-iteration loops and its tick timing could reset), fixed in the release after 0.2.0.
  • fannkuch: Windows x86_64 1.24. Cause: Windows only (1.23 against gcc); not yet analysed for 0.2.0.

Tokens

Mean token count over five offline tokenizers (tools/tokbench/run.sh, ADR 0029) for each program's source file in each language.

program AIL C Rust Go Python AIL / Python
collatz 248 269 245 284 202 1.23
nbody 1626 1596 1574 1580 1397 1.16
spectralnorm 489 557 524 545 361 1.35
mandelbrot 338 391 421 394 268 1.26
fannkuch 524 564 477 588 428 1.22
binarytrees 378 387 435 385 285 1.33
fasta 345 362 399 400 263 1.31
wordfreq 274 842 292 798 199 1.38
matmul 341 405 349 403 237 1.44
sieve 270 324 274 338 216 1.25
total 4833 5699 4990 5715 3856 1.25

Edit loop: the wait on each agent round

Wall milliseconds, best of the runs shown, from the repository root of the release commit (tools/bench/latency.py, tools/bench/publish.sh). ail check, ail context FILE main and ail test are cold processes each time. ail build --cold starts with an empty build cache (AIL_CACHE_DIR set to a new directory); ail build and ail run (cached) are repeats after the build cache holds the program. The ail mcp rows are ail_check calls in one running server: the first call, then the best of the repeats of the same call (mcp.warm.1-4). - means the command did not exit 0 on that host. The programs are examples/hello.ail, examples/json.ail and tools/ailtest/ailtest.ail; the line count is in brackets. On Windows each command starts through ail.cmd and PowerShell (ail.ps1), and that start is inside its time.

command program (lines) Linux x86_64 Darwin arm64 Windows x86_64
ail check hello (2) 16 24 525
ail check json (430) 32 24 545
ail check ailtest (3960) 215 84 672
ail context hello (2) 16 22 520
ail context json (430) 32 24 532
ail context ailtest (3960) 215 82 686
ail test hello (2) 365 200 1246
ail test json (430) 365 201 1269
ail test ailtest (3960) 516 261 1359
ail build --cold hello (2) 917 440 1377
ail build --cold json (430) 1418 669 1972
ail build --cold ailtest (3960) 6534 3200 6984
ail build hello (2) 164 85 727
ail build json (430) 164 82 732
ail build ailtest (3960) 315 137 812
ail run hello (2) 164 89 789
ail run json (430) 164 86 799
ail mcp ail_check, first call hello (2) 12 16 102
ail mcp ail_check, repeat hello (2) 7 8 54
ail mcp ail_check, first call json (430) 26 16 96
ail mcp ail_check, repeat json (430) 7 8 55
ail mcp ail_check, first call ailtest (3960) 170 68 212
ail mcp ail_check, repeat ailtest (3960) 5 6 39
first ./ail run examples/hello.ail in a fresh clone hello (2) 62.9 s 43.7 s n/a

What the numbers say

Generated from the tables above; nothing on this page is written by hand after the run.

  • Small programs. AIL / gcc is below 1 on 6 of 10 (collatz, spectralnorm, mandelbrot, fasta, wordfreq, matmul) and 1 or above on 4 (nbody, fannkuch, binarytrees, sieve); the geometric mean is 0.60.
  • Single thread. With AIL_THREADS=1 the geometric mean of AIL 1T / gcc over the 14 programs is 1.01; with the default thread count it is 0.59. The programs marked ‡ ran on several cores by default (collatz, spectralnorm, matmul, matmul1400).
  • Rust (rustc -C opt-level=3). AIL / Rust is below 1 on 11 of 14 programs (collatz, spectralnorm, mandelbrot, fannkuch, binarytrees, fasta, wordfreq, matmul, vm, raytrace, matmul1400); the geometric mean over all 14 is 0.48.
  • Go (go build). AIL / Go is below 1 on 10 of 14 programs (collatz, nbody, spectralnorm, mandelbrot, fasta, wordfreq, matmul, vm, raytrace, matmul1400); the geometric mean over all 14 is 0.48.
  • Larger programs. AIL / gcc is 1.25 on lzr, 1.14 on vm, 0.93 on raytrace, 0.07 on matmul1400; the geometric mean is 0.56.
  • On Darwin arm64. Geometric mean of AIL / X over the small programs, then the larger ones (rows marked † left out): clang 0.49 and 0.69; Rust 0.48 and 0.61; Go 0.41 and 0.49.
  • On Windows x86_64. Geometric mean of AIL / X over the small programs, then the larger ones (rows marked † left out): gcc 0.82 and 0.57; Rust 0.76 and 0.61; Go 0.64 and 0.53.
  • Tokens. Across the ten programs AIL source is 125% of the Python source and 85% of the C source by mean token count (4833, 5699, 3856). The Rust source is 4990 tokens, so AIL is 97% of it. The Go source is 5715 tokens, so AIL is 85% of it.
  • Edit loop on Linux x86_64. ail check of hello takes 16 ms and of the 3960-line ailtest 215 ms; a repeated ail_check through a warm ail mcp takes 7 ms.
  • Edit loop on Darwin arm64. ail check of hello takes 24 ms and of the 3960-line ailtest 84 ms; a repeated ail_check through a warm ail mcp takes 8 ms.
  • Edit loop on Windows x86_64. ail check of hello takes 525 ms and of the 3960-line ailtest 672 ms; a repeated ail_check through a warm ail mcp takes 54 ms.