Skip to content

feat: add --discard-outliers to filter runs before statistics (fixes #837)#890

Open
leno23 wants to merge 1 commit into
sharkdp:masterfrom
leno23:feat/discard-outliers-837
Open

feat: add --discard-outliers to filter runs before statistics (fixes #837)#890
leno23 wants to merge 1 commit into
sharkdp:masterfrom
leno23:feat/discard-outliers-837

Conversation

@leno23

@leno23 leno23 commented May 26, 2026

Copy link
Copy Markdown

Summary

  • Adds --discard-outliers to remove statistical outliers from timing runs before computing summary statistics and exported timing data.
  • Uses the same modified Z-score method and threshold as the existing outlier warnings.
  • Shows an informational warning when outliers are discarded, with an extra note if more than 5% of runs were removed.

Motivation

Fixes #837. Useful when background interference causes a few bad runs but the majority of samples look reasonable.

Example

hyperfine --discard-outliers --runs 20 './my-command.sh'

If 2 runs are identified as outliers, the summary is recomputed from the remaining 18 runs and the output notes (2 outliers discarded).

Test plan

  • cargo test
  • Unit tests for filter_outliers
  • Integration test that --discard-outliers runs successfully

Remove timing runs identified as statistical outliers before computing
mean, median, standard deviation, and exported results. Warn when more
than 5% of runs are discarded.

Fixes sharkdp#837

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Option to auto-discard statistical outliers

1 participant