How sharkdp/hyperfine works
Hyperfine is a cross-platform command-line benchmarking tool. Users provide commands and options, which are parsed and expanded (including parameter scans), then benchmarked with configurable execution and preparation behavior. Measurements feed metric summaries, progress and reports, and optional result exports. The scheduler and benchmark data types are referenced by the entry point and other indexed files, but their source files are absent from the supplied tree; those nodes therefore have no path. Other links reflect shown calls, indexed references, or README-documented capabilities.
Main entry points: mod.rs Export manager · main.rs Application entry · command.rs Command expansion · markup.rs Markup tables
Components 26
Inputs and configuration
- Application entry
src/main.rs - Argument parsing
src/cli.rs - Run options
src/options.rs - Command expansion
src/command.rs - Parameter scans
src/parameter/range_step.rs - Parameter tokenization
src/parameter/tokenize.rs - Shell syntax
src/shell_syntax.rs
Benchmark execution
- Benchmark scheduler
- Command runner
- Platform timers
src/timer/mod.rs
Measurement and analysis
- Run measurements
- Metrics and units
src/metric.rs - Statistical summaries
src/quantity/statistics.rs - Outlier detection
src/outlier_detection.rs - Benchmark results
Output and exports
- Console report
src/output/report.rs - Progress feedback
src/output/progress_bar.rs - Run warnings
src/output/warnings.rs - Export manager
src/export/mod.rs - CSV export
src/export/csv.rs - JSON export
src/export/json.rs - Markup tables
src/export/markup.rs - AsciiDoc export
src/export/asciidoc.rs - Markdown export
src/export/markdown.rs - Org-mode export
src/export/orgmode.rs
Other components
- CLI user
Connections 30
- CLI user → Application entry: invokes
README.md - Application entry → Argument parsing: parses arguments
src/main.rs - Application entry → Run options: builds options
src/main.rs - Application entry → Command expansion: builds commands
src/main.rs - Command expansion → Parameter scans: expands ranges
src/command.rs - Command expansion → Parameter tokenization: tokenizes values
src/command.rs - Application entry → Shell syntax: checks syntax
src/main.rs - Application entry → Benchmark scheduler: creates and runs
src/main.rs - Benchmark scheduler → Command runner: executes benchmarks
- Command runner → Platform timers: measures execution
src/timer/mod.rs - Platform timers → Run measurements: returns timings
src/timer/mod.rs - Benchmark scheduler → Run measurements: collects runs
- Run measurements → Metrics and units: summarized by
src/metric.rs - Metrics and units → Statistical summaries: computes summaries
src/metric.rs - Run measurements → Outlier detection: checked for outliers
src/outlier_detection.rs - Benchmark scheduler → Console report: updates report
src/output/report.rs - Benchmark scheduler → Progress feedback: updates progress
- Benchmark scheduler → Run warnings: emits warnings
- Application entry → Export manager: configures exports
src/main.rs - Benchmark scheduler → Export manager: exports results
- Export manager → CSV export: selects exporter
src/export/mod.rs - Export manager → JSON export: selects exporter
src/export/mod.rs - Export manager → AsciiDoc export: selects exporter
src/export/mod.rs - Export manager → Markdown export: selects exporter
src/export/mod.rs - Export manager → Org-mode export: selects exporter
src/export/mod.rs - AsciiDoc export → Markup tables: renders table
src/export/asciidoc.rs - Markdown export → Markup tables: renders table
src/export/markdown.rs - Org-mode export → Markup tables: renders table
src/export/orgmode.rs - Export manager → Benchmark results: serializes results
src/export/mod.rs - Console report → Benchmark results: displays results
src/output/report.rs