startbench

command
v0.1.0-alpha.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL