Xo is experimental. The source is now public on GitHub, or try Xo in your browser.
Menu · Performance

Docs

Performance

On this page

This page collects the measurements of Xo against Go that each release records. Every number links to the results file in the repository where it was measured, with the host, the Go version and the raw output. Rows where Xo is slower or uses more memory are listed as plainly as the rows where it is faster.

The numbers here are from 0.55.0 on the linux/arm64 timing host (12 CPUs): the release benchmarks (release-vs-go-v0.55.0-linux-arm64-run.md), compile time, build memory, binary size and std’s tests (release-vs-go-v0.55.0-linux-arm64.md) and the HTTP server against Go at its defaults and tuned (release-vs-go-v0.55.0-linux-arm64-http.md), all with the published release archive; and the survey of every bench/perf case at 0.55.0 (xo-vs-go-survey-2026-11-21.md). Go is go1.26.11 for the 0.55.0 rows.

Last verified: 2026-11-22.

How to read the ratios

  • A ratio is Xo over Go: below 1 means Xo took less time (or memory), above 1 means Xo took more.
  • Run rows come from xo bench --ab, which runs the two programs alternately, A = Go and B = Xo, takes the median of each metric over the rounds, and reports B / A with a 95% interval and a verdict (better, worse or within noise). A ratio is only called a difference when its interval excludes 1.
  • HTTP rows are medians over rounds of a load generator on the same host, the server on six CPUs and the load generator on the other six.

Run time: the release benchmarks

xo bench --ab, 3 rounds, Go as A and Xo as B, each pair running its work enough times (REPEAT, in each row’s heading) that the faster side takes about a second (release-vs-go-v0.55.0-linux-arm64-run.md lines 29-333). Wall time and peak memory (max RSS), Xo over Go:

workloadwallmax RSS
fib0.8850.206
sieve1.35 (slower)0.382
nbody1.007 (slower)0.206
sort0.7580.18
interp0.3030.206
collatz0.9950.207
strings0.2610.994 (even)
coll putget0.480.77
coll get0.4880.669
coll push0.5980.273
coll update0.50.698
coll iter0.0760.67
coll copymut0.4280.427
coll branch0.0010.083
conc spawn0.2980.203
conc fanout0.4670.235
conc pingpong0.9290.164
conc mutex0.3190.17
conc rwmutex7.913 (slower)0.254
conc pmap1.023 (slower)0.222
  • Four rows are slower than Go: sieve 1.35 (1.236 to 1.402), nbody 1.007 (1.003 to 1.008), rwmutex 7.913 (7.784 to 8.0) and pmap 1.023 (1.016 to 1.033). Every row is long enough for xo bench to judge. rwmutex is the largest gap on this page: readers and writers contending on one lock take about 8 times Go’s time.
  • coll branch (0.001) is not a typical speedup. The workload copies a map 2,000 times and adds one key to each copy. Xo’s collections are values with structural sharing, so a copy is cheap and only the changed part is written, where Go’s twin calls maps.Clone for each copy. It shows what that representation saves on this pattern, not how fast Xo code is in general.
  • Peak memory is lower on every row but strings (0.994, within noise): 0.083 to 0.77 of Go’s.

Test time: std’s tests against Go’s

xo test --std-module of the base64 and json ports against go test of the Go packages they were ported from, cold (every cache emptied) and after an edit (one function appended to the module under test), 3 rounds (lines 424-502):

testwallmax RSS
base64 cold0.8142.069 (more)
base64 edit0.6051.472 (more)
json cold0.4472.15 (more)
json edit0.3411.8 (more)

The edit rows are a rerun: the first run’s edit rows tested the unedited std, through a bench bug since fixed (lines 430-436).

HTTP server: Go at its defaults and tuned

The same JSON server in both languages (bench/perf/jitter), 12 rounds a row (release-vs-go-v0.55.0-linux-arm64-http.md lines 25-50). Go is measured twice: at its defaults (GOGC=100), and tuned with GOGC=off GOMEMLIMIT=1GiB, which trades memory for fewer collections. /alloc builds and encodes a JSON object per request; /hello writes a fixed body. cN is the number of connections.

rowserverreq/sp99 µsCPU µs/reqpeak RSS KB
/alloc c32Xo172,58943833.24,388
/alloc c32Go28,2625,452118.319,948
/alloc c32Go tuned132,22067942.91,012,888
/alloc c256Xo186,7123,28232.010,716
/alloc c256Go57,21737,68581.940,308
/alloc c256Go tuned139,4115,96241.91,015,520
/hello c32Xo364,0542277.73,182
/hello c32Go273,55763712.517,780
/hello c32Go tuned306,38227611.6986,248
/hello c256Xo883,0728736.56,742
/hello c256Go479,4212,66410.224,044
/hello c256Go tuned710,1941,1628.0986,196

Xo over Go, requests a second (lines 52-69):

rowover Goover Go tuned
/alloc c326.1071.305
/alloc c2563.2631.339
/hello c321.3311.188
/hello c2561.8421.243
  • Go’s default /alloc row is weak because its collector runs many times a second on this server’s small live heap (GOGC=100). Compare with the tuned column for Go’s best case: Xo serves 1.31 to 1.34 times its rate on /alloc, at 0.004 (c32) and 0.011 (c256) of its peak memory.
  • At fixed open loop rates (10,000 and 20,000 requests a second, 64 connections) all three serve the rate; Xo’s p99 is 116 and 140 µs, Go’s 389 and 779 µs, tuned Go’s 128 and 157 µs (lines 31-38).

Compile time, binary size and build memory

Xo 0.55.0 against Go 1.26.11 on linux/arm64, one build each, wall milliseconds and the build’s peak resident memory, each tool with its default caches (Go’s build cache; Xo’s back-end caches and its run cache) (release-vs-go-v0.55.0-linux-arm64.md lines 22-48). Cold empties every cache; warm is the third unchanged build; edit is a build after one function is appended. The like-for-like row is coll, one program on each side:

cold mswarm msafter an edit mspeak MB cold / warm / editbinary MB
Go13802081299 / 23 / 702.31
Xo12981196404 / 13 / 762.62
  • Cold builds take about as long as Go’s (1218 to 1396 ms for the Xo programs, 1340 to 1380 ms for Go’s three) but peak higher: 392 to 432 MB against Go’s 290 to 313 MB.
  • Unchanged rebuilds take 8 to 21 ms and 13 MB, against Go’s 18 to 20 ms and 21 to 24 MB: Xo’s run cache answers them. The second build after a cold one is slower (62 to 115 ms): it is the first that compiles against std’s precompiled variants, which the cold build starts in the background.
  • After an edit, Xo takes 59 to 96 ms against Go’s 70 to 81 ms: faster on some programs, slower on others (coll 96 against 81).
  • Binaries are larger than Go’s: 2.51 to 2.64 MB against Go’s 2.30 to 2.31 MB.
  • A large program (0.55.0, on the Mac): a program linking the Azure compute client (armcompute) against Go’s armcompute v9.0.0 (release-vs-go-v0.55.0.md lines 122-127): cold 816 ms and 481 MB against Go’s 4766 ms and 920 MB (with std’s variants already built; 2709 ms and 859 MB for the first program after install), warm 51 ms against 102, an edit 235 ms against 331, binary 7.99 MB against 9.30.

Where Xo is behind or even

  • The four slower run rows above: sieve, nbody, rwmutex and pmap.

  • Cold build memory and binary size, above: both are above Go’s.

  • Warm rebuilds with the run cache off: a diagnostic, not the default: coll then rebuilds unchanged in 78 ms at 76 MB against Go’s 20 ms at 23 MB (lines 49-71): the front end still reads std’s declarations and checks the program’s modules on every build.

  • Test builds use more memory: xo test of the base64 and json ports takes 0.341 to 0.814 of go test’s wall time, but 2.069 and 2.15 times its peak memory cold and 1.472 and 1.8 times after an edit The peak is the compiler’s own heap, not the test binary: parse trees of std’s declarations, and every std module that imports the edited one checked again. At the front end’s peak in a build of coll, decoding std’s parse trees holds 40.92% of the 114.44MB in use on linux/arm64 (release-vs-go-v0.55.0-linux-arm64.md lines 503-527) and 41.97% of the 112.58MB in use on the Mac (release-vs-go-v0.55.0.md lines 348-372).

  • Standard library ports still slower than Go’s packages in the 0.55.0 survey of 642 cases (geometric mean 0.704; 34 of the 492 cases that run 5 ms or more are more than 10% slower; lines 30-56). The largest gaps:

    • ordered comparison of strings and bytes (ordcmp): 2.46 and 2.43 times Go;
    • integer formatting (strconv/itoa): 1.50 times Go;
    • AES block modes, the sieve, trimming characters and CSV formatting: 1.29 to 1.41 times Go.

    The 2026-11-07 survey’s largest gaps (time layouts, metrics, logging below the level) are now faster than Go; jsontoken/write is still 1.135 times Go (lines 58-73).

    Each fix is logged with its timing in the module’s change log.

Method

  • Host: every row on this page but the large program (the Mac) ran on the linux/arm64 timing host (Linux aarch64, 12 CPUs, 39 GB); the HTTP rows put the server on CPUs 0 to 5 and the load generator on 6 to 11.
  • Go: go1.26.11.
  • Rounds: 3 per row for the release benchmarks and std’s tests, 12 for the HTTP rows (3 at each of four code alignments), 5 per case for the survey (alternating, medians of wall time).
  • Ratios: Xo’s median over Go’s median for the same metric. xo bench --ab also prints the 95% interval and calls a row better or worse only when the interval excludes 1. Run it yourself with xo bench --ab A B on two built programs (see the toolchain reference).
  • Scripts: scripts/release-vs-go.sh (run, compile, test, HTTP), scripts/release-vs-go-http.sh (both Go columns) and scripts/twincheck -time (the survey), all in the repository.
  • This page is refreshed with each release’s run.
↑ index