D-Berg/crap

Counter Reading Acquisition Platform - A fork of POOP with macOS support.

Zig

24

105 commits

updated Jul 14, 2026

See the code

See what people are saying

SourceMessageScoreDate

Crap: A Fork of Poop

1

Sep 30, 2026

README

Crap - A fork of poop

Stop flushing your performance down the drain.

Overview

This command line tool uses Linux's perf_event_open and macOS kperf functionality to compare the performance of multiple commands with a colorful terminal user interface.

Screenshot 2025-12-06 at 11 29 16

Usage

Usage: crap [options] <command1> ... <commandN>

Compares the performance of the provided commands.

Options:
 -d, --duration <ms>    (default: 5000) how long to repeatedly sample each command
 --color <when>         (default: auto) color output mode
                            available options: 'auto', 'never', 'ansi'
 -s, --shell <shell>    (default: none) specify which shell to run commands in
 -w, --warmup <count>   (default: 0) specify number of warmups before running each command
 -f, --allow-failures   (default: false) compare performance if a non-zero exit code is returned

Supported Platforms and counters

CountersLinuxmacOSWindows
wall_timeyesyesyes
peak_rssyesyesyes
cpu_cyclesyessudono
instructionsyessudono
cache_referencesyesnono
cache_missesyessudono
branch_missesyessudono

Building from source and installation

Tested with Zig 0.16.0.

# set install path to ~/.local to install in ~/.local/bin
zig build -Doptimize=ReleaseSafe -p <install_path>

Comparison with Hyperfine

Crap (so far) is brand new, whereas Hyperfine is a mature project with more configuration options and generally more polish.

However, crap does report peak memory usage as well as 5 other hardware counters, which I personally find useful when doing performance testing. Hey, maybe it will inspire the Hyperfine maintainers to add the extra data points!

By default crap does not run the commands in a shell, use -s/--shell zsh to run the command in a shell. This has the upside of not including shell spawning noise in the data points collected, and the downside of not supporting strings inside the commands. Hyperfine by default runs the commands in a shell, with command line options to disable this.

Crap treats the first command as a reference and the subsequent ones relative to it, giving the user the choice of the meaning of the coloring of the deltas. Hyperfine by default prints the wall-clock-fastest command first, with a command line option to select a different reference command explicitly.

Note: on macos to get some of the extra performance counters, sudo privelage is needed.

Credits

benchmark
cli
tool
zig
zig-program

Significant stargazers

Jan-Erik Rediger

1,029 followers · starred Dec 2025

Ryan Liptak

259 followers · starred Jan 2026

Adam Skoufis

30 followers · starred Apr 2026

Paul Ebose

112 followers · starred Jun 2026

D-Berg/crap

Counter Reading Acquisition Platform - A fork of POOP with macOS support.

Zig

24

105 commits

updated Jul 14, 2026

See the code

See what people are saying

SourceMessageScoreDate

Crap: A Fork of Poop

1

Sep 30, 2026

README

Crap - A fork of poop

Stop flushing your performance down the drain.

Overview

This command line tool uses Linux's perf_event_open and macOS kperf functionality to compare the performance of multiple commands with a colorful terminal user interface.

Screenshot 2025-12-06 at 11 29 16

Usage

Usage: crap [options] <command1> ... <commandN>

Compares the performance of the provided commands.

Options:
 -d, --duration <ms>    (default: 5000) how long to repeatedly sample each command
 --color <when>         (default: auto) color output mode
                            available options: 'auto', 'never', 'ansi'
 -s, --shell <shell>    (default: none) specify which shell to run commands in
 -w, --warmup <count>   (default: 0) specify number of warmups before running each command
 -f, --allow-failures   (default: false) compare performance if a non-zero exit code is returned

Supported Platforms and counters

CountersLinuxmacOSWindows
wall_timeyesyesyes
peak_rssyesyesyes
cpu_cyclesyessudono
instructionsyessudono
cache_referencesyesnono
cache_missesyessudono
branch_missesyessudono

Building from source and installation

Tested with Zig 0.16.0.

# set install path to ~/.local to install in ~/.local/bin
zig build -Doptimize=ReleaseSafe -p <install_path>

Comparison with Hyperfine

Crap (so far) is brand new, whereas Hyperfine is a mature project with more configuration options and generally more polish.

However, crap does report peak memory usage as well as 5 other hardware counters, which I personally find useful when doing performance testing. Hey, maybe it will inspire the Hyperfine maintainers to add the extra data points!

By default crap does not run the commands in a shell, use -s/--shell zsh to run the command in a shell. This has the upside of not including shell spawning noise in the data points collected, and the downside of not supporting strings inside the commands. Hyperfine by default runs the commands in a shell, with command line options to disable this.

Crap treats the first command as a reference and the subsequent ones relative to it, giving the user the choice of the meaning of the coloring of the deltas. Hyperfine by default prints the wall-clock-fastest command first, with a command line option to select a different reference command explicitly.

Note: on macos to get some of the extra performance counters, sudo privelage is needed.

Credits

benchmark
cli
tool
zig
zig-program

Significant stargazers

Jan-Erik Rediger

1,029 followers · starred Dec 2025

Ryan Liptak

259 followers · starred Jan 2026

Adam Skoufis

30 followers · starred Apr 2026

Paul Ebose

112 followers · starred Jun 2026

Languages

Zig

99.9%