Skip to main content
Version: 0.3

Energy, SQLite, streams and micro programs

Every result on this page is from an Apple M4 (macOS 15.5) with Node v26.12.0 and Bun 1.4.4. There are no Linux results for energy, SQLite or streams yet.

Energy (5 Nov 2026)​

powermetrics samples CPU package power every 100 ms while the workload runs. The samples are integrated to joules, and the idle baseline (0.18 W) is subtracted. Source: bench/results/2026-11-05-Apple-M4-energy.csv.

workloadunitxistoNodeBun
sievejoules per run0.5081.4191.176
count lines in a 1 GB log, streamingjoules per run2.4036.8942.384
Todo API list route under loadjoules per 100k requests8.21311.8357.962

xisto uses 2.8 times less energy than Node on the sieve and 2.3 times less than Bun. Bun is slightly better on the HTTP list route (3% less) and about even on the stream.

SQLite (5 Nov 2026)​

200,000 inserts in one transaction, 2,000 point reads and a scan of 198,000 rows into typed objects, on an in-memory database. xisto uses the node:sqlite API; Bun uses bun:sqlite. Median of 5. Source: bench/results/2026-11-05-Apple-M4-sqlite.csv.

runtimetimepeak RSSwhat you ship
Bun0.07 s55.7 MB84.55 MB
xisto0.09 s33.8 MB1.02 MB
Node0.21 s151.4 MB58.38 MB

Bun is faster here. xisto's executable includes SQLite itself.

Streams (5 Nov 2026)​

Count the lines containing ERROR in a 977 MB log of 15 million lines, by streaming and by reading the whole file. Median of 3. Source: bench/results/2026-11-05-Apple-M4-streams.csv.

runtimemodetimepeak RSS
xistostream0.32 s1.3 MB
xistoreadFileSync0.32 s977.8 MB
Bunstream0.60 s56.5 MB
Nodestream1.14 s111.8 MB
NodereadFileSyncfailed—

Node's whole-file read fails: a 1 GB string is longer than V8 allows. A stream keeps xisto's memory at the size of one line; reading the whole file costs its size.

Micro programs (7 Nov 2026)​

Median of 5, release build unless noted. Source: bench/results/2026-11-07-Apple-M4.csv.

programxistoxisto --devNodeBun
fib0.02 s, 1.3 MB0.11 s0.12 s, 66.1 MB0.03 s, 14.1 MB
mandelbrot0.52 s, 1.3 MB2.16 s0.59 s, 68.9 MB0.70 s, 16.1 MB
nbody0.39 s, 1.3 MB3.78 s0.49 s, 69.2 MB0.45 s, 19.2 MB
objects0.01 s, 1.3 MB0.06 s0.08 s, 68.6 MB0.02 s, 28.4 MB
sieve0.08 s, 29.9 MB0.46 s0.33 s, 296.0 MB0.23 s, 245.7 MB

--dev compiles at -O0 for a fast edit loop; it is 4 to 10 times slower than release. The experimental QBE backend (--backend=qbe) ran fib in 0.04 s and nbody in 1.16 s, with a 0.04 s compile.

The cross-machine suite (7 Nov 2026)​

bench/vm.py runs one suite of small programs on any machine; this is the M4 run, median of 3. Source: bench/results/vm-mac-2026-11-07-final.txt. The ratio is against the better of Node and Bun.

programwhat it exercisesxistoNodeBunXisto vs best
fibrecursion, int0.022 s0.120 s0.040 s1.83×
sievearrays of booleans0.095 s0.358 s0.246 s2.59×
binarytreesmany short-lived trees (depth 18)0.243 s0.440 s0.389 s1.60×
closures10M updates through captured, reassigned variables0.011 s0.112 s0.042 s3.95×
generators3M values through nested generators0.004 s0.129 s0.037 s9.53×
genericsgeneric functions over 3 types, 2M elements each0.051 s0.317 s0.119 s2.36×
dateparse, format, local fields of 1M dates0.146 s1.043 s0.456 s3.13×
regexvalidate 400k emails, parse 300k log lines, replace and split 22 MB0.157 s0.377 s0.202 s1.29×
promise10k tasks on timers, then small concurrent rounds0.020 s0.096 s0.027 s1.36×
redospatterns that make a backtracking engine explode0.012 s7.456 s3.641 s291.5×

redos tests /^(a+)+$/ against 22 as followed by !, and similar patterns. V8 and JavaScriptCore backtrack, and the time grows exponentially with the input. xisto's default regex engine is linear in the input, so it has nothing to explode. A pattern that needs backtracking (backreferences, lookaround) uses a second engine, which stops with a RangeError after 50 million steps.

Older runs of this suite on Linux and Windows (bench/results/vm-2026-11-07/) predate the work of 9–10 Nov and are not summarized here.

Executable size​

xistoNodeBun
fib69,288 B61,220,224 B88,660,864 B
hello HTTP server111,088 B61,220,224 B88,660,864 B
SQLite program1.02 MB58.38 MB84.55 MB

For Node and Bun the size is the runtime binary and its private libraries. Sources: bench/results/2026-11-07-Apple-M4.csv, bench/results/2026-11-07-Apple-M4-http.csv, bench/results/2026-11-05-Apple-M4-sqlite.csv.

See also​