Documentation
¶
Overview ¶
Command startbench compares the start-up cost of two sweef binaries, for the size-budget work: a change that shrinks the binary (compressed embeds, fewer tables) must not make the browser start or load a first page slower, and must not use more memory.
go run ./tools/startbench -a /tmp/sweef.before -b /tmp/sweef.after [-n 30]
Each case runs the two binaries alternately (so machine drift hits both), n times, and prints the median, mean and p90 of the wall time, the median user+system CPU time (steadier than wall time when the machine is shared) and the peak resident set size (getrusage ru_maxrss of the child), and the difference of the medians. Cases:
version sweef version process start: runtime init, package init, paging in the image
page-cold sweef eval <local page> <expr> first page, empty SWEEF_CACHE_DIR: compiles the JS prelude
(inflates every embedded script) and loads Intl + time zone data
page-warm the same with the prelude bytecode cached what the second and later starts cost
gui-first sweef gui --headless --no-restore --out D start to the first composited chrome frame (UI assets)
The page case needs no network: the tool serves the page itself on a loopback port. Peak RSS and CPU time are read on Linux and macOS; elsewhere they are reported as 0.