@@ -0,0 +1,102 @@
3+`bench.sh` script at the root of the repo is the top level driver for running
4+benchmarks. It runs the requested benchmarks and then creates a report from the
5+results using the `bench-show` package. Try `bench.sh --help` for available
10+Run these commands from the root of the repo.
12+To run the default benchmarks:
18+To run all benchmarks:
21+$ ./bench.sh --benchmarks all
24+To run `linear` and `linear-async` benchmarks:
27+$ ./bench.sh --benchmarks "linear linear-async"
30+To run only the base benchmark and only the benchmarks prefixed with
31+`StreamD` in that (anything after a `--` is passed to gauge):
34+$ ./bench.sh --benchmarks base -- StreamD
37+## Comparing benchmarks
39+To compare two sets of results, first run the benchmarks at the baseline
46+And then run with the `--append` option at the commit that you want to compare
47+with the baseline. It will show the comparison with the baseline:
53+Append just adds the next set of results in the same results file. You can keep
54+appending more results and all of them will be compared with the baseline.
56+You can use `--compare` to compare the previous commit with the head commit:
59+$ ./bench.sh --compare
62+To compare the head commit with some other base commit:
65+$ ./bench.sh --compare --base d918833
68+To compare two arbitrary commits:
71+$ ./bench.sh --compare --base d918833 --candidate 38aa5f2
74+Note that the above may not always work because the script and the benchmarks
75+themselves might have changed across the commits. The `--append` method is more
78+## Available Benchmarks
80+The benchmark names that you can use when running `bench.sh`:
82+* `base`: a benchmark that measures the raw operations of the basic streams
83+ `StreamD` and `StreamK`.
85+* `linear`: measures the non-monadic operations of serial streams
86+* `linear-async`: measures the non-monadic operations of concurrent streams
87+* `linear-rate`: measures the rate limiting operations
88+* `nested`: measures the monadic operations of all streams
89+* `all`: runs all of the above benchmarks
91+## Reporting without measuring
93+You can use the `--no-measure` option to report the already measured results in
94+the benchmarks results file. A results file may collect an arbitrary number of
95+results by running with `--append` multiple times. Each benchmark has its own
96+results file, for example the `linear` benchmark has the results file at
97+`charts/linear/results.csv`.
99+You can also manually edit the file to remove a set of results if you like or
100+to append results from previously saved results or from some other results
101+file. After editing you can run `bench.sh` with the `--no-measure` option to
102+see the reports corresponding to the results.