You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,8 @@ In addition, you can optionally output an extended set of statistics:
136
136
***sample size** - the number of measurements taken
137
137
***mode** - the measured values that occur the most. Often one value, but can be multiple values if they occur exactly as often. If no value occurs at least twice, this value will be `nil`.
138
138
139
+
Benchee can also [remove outliers](#remove-outliers).
140
+
139
141
## Installation
140
142
141
143
Add `:benchee` to your list of dependencies in `mix.exs`:
@@ -303,6 +305,7 @@ So, what happens if a function executes too fast for Benchee to measure? If Benc
303
305
* essentially every single measurement is now an average across 10 runs making lots of statistics less meaningful
304
306
305
307
Benchee will print a big warning when this happens.
308
+
306
309
#### Measuring Memory Consumption
307
310
308
311
Starting with version 0.13, users can now get measurements of how much memory their benchmarked scenarios use. The measurement is **limited to the process that Benchee executes your provided code in** - i.e. other processes (like worker pools)/the whole BEAM isn't taken into account.
**Note about after_each hooks:**`after_each` hooks currently don't work when profiling a function, as they are not passed the return value of the function after the profiling run. It's already fixed on the elixir side and is waiting for release, likely in 1.14. It should then just work.
544
547
548
+
### Remove Outliers
549
+
550
+
Benchee can remove outliers from the gathered samples.
551
+
That is, as determined by percentiles/quantiles (we follow [this approach](https://en.wikipedia.org/wiki/Interquartile_range#Outliers)).
552
+
553
+
You can simply pass `exclude_outliers: true` to Benchee to trigger the removal of outliers.
554
+
555
+
```elixir
556
+
Benchee.run(jobs, exclude_outliers:true)
557
+
```
558
+
559
+
The outliers themselves (aka the samples that have been determined to be outliers)
560
+
as well as the lower/upper bound after which samples are considered outliers are accessible
561
+
in the `Benchee.Statistics` struct.
562
+
545
563
### Saving, loading and comparing previous runs
546
564
547
565
Benchee can store the results of previous runs in a file and then load them again to compare them. For example this is useful to compare what was recorded on the main branch against a branch with performance improvements. You may also use this to benchmark across different exlixir/erlang versions.
0 commit comments