Skip to main content
Version: Next (unreleased)

Xisto vs Rust

13 Nov 2026, main 4a2f388, on the two AWS VMs. Rust is the language the Benchmarks Game's fastest programs are usually written in, so this is the comparison that says whether xisto's generated C keeps up with a systems language.

Setup​

  • Rust programs: every Rust program of the official source package (BSD-3), not only the fastest, built as the site builds them: a Cargo project with the crates they use (typed-arena, rayon, toolshed, bumpalo, regex, hashbrown, ...), opt-level = 3, codegen-units = 1, -C target-cpu=native, GMP for pidigits (bench/benchmarksgame/langs.md). rustc 1.99.1. On arm64 the programs that use x86 SIMD do not compile (nbody #5/#7/#9, fannkuch-redux #6, regex-redux #7, pidigits #4).
  • Excluded: nbody_7 and nbody_9 compute 1/√x with the approximate rsqrtps instruction and give different doubles; xisto promises Node's doubles, so it is not compared against a different computation.
  • xisto: every variant in bench/benchmarksgame/, built with XISTO_CPU=native.
  • Command: python3 bench/benchmarksgame/langs.py 3 rust=~/rustbg/target/release, scored with python3 bench/placar.py RESULTS (see How every run is measured).
  • Excluded xisto variant: spectralnorm-8 takes 1/d from a float32 division refined to the same double. It is measured (0.422 s on the Xeon, 0.874 s on the Graviton2) but not scored: the problem asks for the double division, and the scoreboard keeps the problem as stated.
  • Steal during the round: +229 on the Xeon, +638 on the Graviton2.

Xeon E5-2686 v4 (AWS t2.medium, 2 vCPUs, AVX2)​

Source: bench/results/vm-2026-11-13/rust-ubuntu-xeon-2026-11-13-4a2f388.txt.

problemxistoRustxisto timeRust timexisto CPURust CPUxisto memRust memresult
fastafastafasta_71.124 s1.989 s0.34 s2.66 s2.4 MB2.9 MBwin
regex-reduxregexredux-2regexredux_60.691 s1.106 s0.96 s1.24 s149.1 MB150.5 MBwin
k-nucleotideknucleotide-7 †knucleotide_61.358 s2.106 s2.66 s3.82 s68.7 MB138.6 MBwin
mandelbrotmandelbrot-6mandelbrot_3 †1.339 s1.996 s2.53 s3.85 s7.3 MB12.1 MBwin
pidigitspidigitspidigits_30.626 s0.839 s0.62 s0.84 s2.6 MB3.0 MBwin
reverse-complementrevcomp-10revcomp0.836 s1.105 s0.24 s0.25 s10.9 MB123.4 MBwin
fannkuch-reduxfannkuchredux-5fannkuchredux_66.621 s7.864 s13.08 s15.63 s2.3 MB2.2 MBwin
binary-treesbinarytrees †binarytrees_21.631 s1.897 s3.07 s3.57 s70.1 MB130.2 MBwin
n-bodynbodynbody_62.453 s2.703 s2.45 s2.70 s2.0 MB2.0 MBwin
spectral-normspectralnormspectralnorm_70.460 s0.462 s0.89 s0.89 s2.2 MB2.4 MBtie

9 wins, 1 tie, no losses. xisto's peak memory is at or below Rust's on every problem but fannkuch-redux, 2.3 MB against 2.2 MB in this round (2.3 against 2.3–2.4 MB in the other rounds of the day). † Chosen for memory (up to 2% slower with at least 10% less memory, or up to 5% slower with at least 25% less). nbody_9 and nbody_7 are excluded because they compute 1/√x with the approximate rsqrtps instruction and give different doubles.

Graviton2 (AWS t4g.small, 2 vCPUs, arm64)​

Source: bench/results/vm-2026-11-13/rust-arm-graviton2-2026-11-13-4a2f388.txt.

problemxistoRustxisto timeRust timexisto CPURust CPUxisto memRust memresult
fastafastafasta_20.546 s1.839 s0.38 s3.06 s1.8 MB2.5 MBwin
reverse-complementrevcomp-10revcomp0.282 s0.564 s0.28 s0.36 s10.1 MB123.2 MBwin
fannkuch-reduxfannkuchredux-5fannkuchredux_48.586 s14.326 s17.14 s27.91 s1.8 MB1.9 MBwin
regex-reduxregexredux-2regexredux_60.798 s1.291 s1.25 s1.58 s148.6 MB149.7 MBwin
k-nucleotideknucleotide-7knucleotide_62.986 s4.319 s5.89 s7.98 s64.6 MB138.3 MBwin
binary-treesbinarytrees-3binarytrees_21.826 s2.190 s3.57 s4.20 s113.8 MB130.0 MBwin
pidigitspidigitspidigits_32.042 s2.217 s2.04 s2.21 s2.1 MB2.8 MBwin
n-bodynbodynbody_24.602 s4.985 s4.60 s4.98 s1.5 MB1.6 MBwin
mandelbrotmandelbrot-8mandelbrot_42.627 s2.792 s5.21 s5.49 s6.9 MB32.4 MBwin
spectral-normspectralnorm-7spectralnorm_51.220 s1.230 s2.43 s2.45 s1.8 MB2.1 MBtie

9 wins, 1 tie, no losses; xisto's peak memory is below Rust's on every problem. Reverse-complement is revcomp-10, the fastest xisto variant here with 10 MB: it reads each sequence backwards one block at a time and moves the newlines to their output places before the reverse, so each line is one run.

The ties​

spectral-norm, both machines: the time is the 1.21 billion double divisions 1/d the problem asks for. A C loop doing only those divisions takes the same CPU as both programs (0.88 s on the Xeon, 2.42 s on the Graviton2), so no program can be 5% ahead without caching the matrix (~240 MB) or computing 1/d another way, which the problem does not allow. xisto is ahead by 1–2% on both.

mandelbrot on the Graviton2, a tie until e897e76, is now a win (6% ahead). Two changes:

  • mandelbrot-8 runs twelve pixels at a time after a byte with a pixel inside the set, and writes 2·zr·zi as p + p with p = zr·zi. Doubling is exact, so the doubles are the same, and the chain is an addition shorter than a multiplication.
  • The compiler's lane planner (src/emit.c) picks the split that puts the most work in vectors: twelve copies become three vectors of four instead of one of eight and four scalars. The C of every other program is unchanged.

The xisto programs​

Each name links to its source on GitHub; the original Node programs are in bench/benchmarksgame/node/.

problemxisto variantwhat it does
spectral-normspectralnorm (Xeon), spectralnorm-6, spectralnorm-7the products split in equal shares of rows across threads; the denominator of A carried along each row by additions; #7 joins the 40 products through Atomics counters instead of messages. Same divisions, same order, same doubles as the plain program
n-bodynbodythe plain program with types
fannkuch-reduxfannkuchredux-5720 ranges to a pool of workers; the permutation as bytes in vector registers (a flip is one shuffle); two permutations' flip chains counted in the same loop
binary-treesbinarytrees, binarytrees-2, binarytrees-3trees built in parallel (xisto:parallel or a worker pool); nodes of 8 bytes (32-bit references), a statement's temporary trees freed right after it
mandelbrotmandelbrot-6 (Xeon), mandelbrot-8 (Graviton2)chunks of rows to a pool of workers; 16 (#6) or 8 and 12 (#8) pixels per call as SIMD vectors; rows written out as they finish
fastafastathe plain program with types; the random sequences from xisto:random
k-nucleotideknucleotide-7the sequence at two bits per nucleotide, packed in parallel; small frames counted in arrays indexed by key, the big ones in partitions
reverse-complementrevcomp-10each sequence read backwards from the file one block at a time, blocks made by workers into a shared ring and written in order (10 MB); the newlines moved to their output places before the reverse, so each line is one run
regex-reduxregexredux-2the nine counts in a worker while the main thread does the replacements; the 50 MB string shared with the worker, not copied
pidigitspidigitsthe plain program with types (BigInt on xisto's GMP-backed integers)

What changed since 10 Nov​

The 10 Nov round had 7 wins, 3 ties on the Xeon and 8 wins, 1 tie, 1 loss (mandelbrot) on the Graviton2, with xisto using more memory than Rust on binary-trees, fasta, k-nucleotide and reverse-complement. Between 10 and 13 Nov:

  • Compiler and runtime, for every program: 32-bit references for classes that only point to themselves (the binary-trees node goes from 16 to 8 bytes); objects that cannot outlive one statement go to a region given back to the system after it; the order of SIMD lanes chosen per architecture; a 1 MB stdout pipe on Linux; large strings sent to a worker without a copy; Int32Array and Atomics (wait, notify) as in Node.
  • New variants: mandelbrot-6/-7 (lane copies, output written as rows finish), fannkuchredux-5 (two permutations' flips in one loop), knucleotide-7 (2 bits per base), revcomp-9 (each sequence read back to front, one block at a time), regexredux-2 (counts in a worker), spectralnorm-7 (an Atomics barrier), mandelbrot-8 (twelve pixels per run, with the lane planner above), revcomp-10 (one run per line).

Result files​

  • bench/results/vm-2026-11-13/rust-ubuntu-xeon-2026-11-13-4a2f388.txt
  • bench/results/vm-2026-11-13/rust-arm-graviton2-2026-11-13-4a2f388.txt
  • Earlier rounds of the same day (*-937cb49, *-4a10af3, *-5296927, *-e5fb066, *-efd0fef, *-e897e76) show each step of the work above.