67.15. hyperfine-1.20.0
Statistical command-line benchmarking with warmup and outliers
| Version | 1.20.0, release 1 |
| Shelf | devtools — Debuggers, tracers, profilers, analysers, linters, language servers and developer utilities |
| Phase | 40_lang (Languages), 23 of 186 in build order |
| Licence | MIT OR Apache-2.0 |
| Homepage | https://github.com/sharkdp/hyperfine |
| Build time | 2.3 SBU |
| Installed size | 1.3 MiB in 4 files |
| Recipe | ports/core/devtools/hyperfine/kpkgbuild |
About
hyperfine benchmarks commands: it runs each one many times, after optional warm-up runs, and reports the mean, the spread and the minimum and maximum, warns about statistical outliers, and compares several commands against each other. It is the general form of the discipline kdos march applies to one question, whether a processor tuning flag is worth keeping: several runs, the machine’s own noise measured, and no difference reported that does not clear it.
Why it is in KDOS
The comment above it in script/phases/40_lang/packages.d/devtools.txt:
kdos marchalready encodes this discipline for one question: several runs, the median, the machine's own noise, and no "win" that does not clear it.
Sources
hyperfine-1.20.0.tar.gz(326.3 KiB)
sha256f90c3b096af568438be7da52336784635a962c9822f10f98e5ad11ae8c7f5c64
upstream: https://github.com/sharkdp/hyperfine/archive/refs/tags/v1.20.0.tar.gz
archive copy: sources-1/devtools--hyperfine-1.20.0.tar.gzhyperfine-vendor-1.20.0.tar.xz(15.6 MiB)
sha256b8a66105491613a628e80184d0c61c8f0c2bd1508df773990506bc54e963729d
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-1/devtools--hyperfine-vendor-1.20.0.tar.xz
Dependencies
Depends on: rust.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install hyperfine'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/devtools/hyperfine.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/devtools/hyperfine
echo 'f90c3b096af568438be7da52336784635a962c9822f10f98e5ad11ae8c7f5c64 hyperfine-1.20.0.tar.gz' | sha256sum -c -
echo 'b8a66105491613a628e80184d0c61c8f0c2bd1508df773990506bc54e963729d hyperfine-vendor-1.20.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/hyperfine
SRC=$SRC_ROOT/hyperfine-1.20.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf hyperfine-1.20.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
tar xf $PORT_SRC/${name}-vendor-${version}.tar.xz
export RUSTFLAGS="-C target-feature=-crt-static"
cargo build --release --frozen --offline
install -Dm755 target/release/hyperfine $PKG/usr/bin/hyperfine
install -Dm644 doc/hyperfine.1 $PKG/usr/share/man/man1/hyperfine.1
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/hyperfine, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf hyperfine-1.20.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/hyperfine, and runs the triggers its paths call for.
Contents
Installed programs: hyperfine.
Installed directories: /usr/share/licenses/hyperfine.
Short descriptions
hyperfine |
command-line benchmarking tool |
Notes
The manual page is shipped rendered in the source, as doc/hyperfine.1, and installed as it is.