<div align="center">
<h1>hyperfoot</h1>
<p><strong>Benchmark the resource footprint of commands</strong></p>
<p>
<img alt="License" src="https://img.shields.io/badge/license-MIT-green">
<img alt="Rust" src="https://img.shields.io/badge/rust-1.85%2B-orange">
<img alt="Edition" src="https://img.shields.io/badge/edition-2024-blue">
<a href="https://crates.io/crates/hyperfoot"><img alt="crates.io" src="https://img.shields.io/crates/v/hyperfoot.svg"></a>
</p>
<p>
<a href="#install">Install</a>
·
<a href="#quickstart">Quickstart</a>
·
<a href="#development">Development</a>
</p>
<img alt="hyperfoot comparing two commands" src="docs/screenshot.png" width="100%">
</div>
---
## Install
Requires [Rust](https://rustup.rs) **1.85+** and `~/.cargo/bin` on your `PATH`.
```bash
cargo install hyperfoot
```
Verify:
```bash
hyperfoot --help
```
<details>
<summary><strong>Build from source</strong> — for development or unreleased changes</summary>
```bash
git clone https://github.com/cesarferreira/hyperfoot.git
cd hyperfoot
cargo install --path . --locked
# or
make install-release
```
Debug install (faster compile, larger binary):
```bash
make install
```
Run without installing:
```bash
make build-release
./target/release/hyperfoot
```
</details>
<a id="quickstart"></a>
## Quickstart
Report one command's resource footprint:
```bash
$ hyperfoot 'cargo build'
Benchmark cargo build
Time 12.84 s ± 0.31 s
CPU 624.3 %
CPU time 78.91 s
Peak memory 2.14 GB
Disk read 482.30 MB
Disk write 127.80 MB
Processes 43
Threads 184
10 runs
```
Compare two or more commands:
```bash
$ hyperfoot 'npm run build' 'bun run build'
npm run build bun run build
──────────────────────────────────────────────────────
Time 8.42 s 2.11 s
CPU 483.0 % 612.0 %
CPU time 40.65 s 12.92 s
Peak memory 1.24 GB 714.00 MB
Disk read 382.00 MB 241.00 MB
Disk write 147.00 MB 89.00 MB
Processes 58 21
✓ bun run build
3.99× faster than npm run build
42% less memory
37% less disk reads
39% less disk writes
```
Other flags:
```bash
hyperfoot --runs 20 --warmup 3 'cargo test' # more samples, discard the first 3
hyperfoot --prepare 'cargo clean' 'cargo build' # reset state before every run
hyperfoot --export-json out.json --export-csv out.csv 'ls' # machine-readable output
```
On Linux, when the process's own cgroup v2 subtree is writable (typical under
a systemd user session), memory and disk I/O are exact kernel-reported
totals instead of estimates from polling — no `~` marker on those lines.
<a id="development"></a>
## Development
```bash
make build-release # build target/release/hyperfoot
make install # build + install to ~/.cargo/bin (debug)
make test # cargo test
make check # cargo check + clippy
make release LEVEL=patch # bump version, regenerate CHANGELOG.md, tag, publish, push
```
`make release` requires [cargo-release](https://github.com/crate-ci/cargo-release)
and [git-cliff](https://github.com/orhun/git-cliff); pushing the resulting `v*`
tag triggers the release workflow, which builds the multi-platform binaries and
publishes a GitHub Release.
## License
MIT