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
* update criterion settings
* add benches to all targets
* add benchmarks feature
* use config for profiling
* mention configurable defaults
* update to use cargo criterion
* add cargo criterion note
* note about profiling and windows
Copy file name to clipboardExpand all lines: CONTRIBUTE.md
+4-1
Original file line number
Diff line number
Diff line change
@@ -171,9 +171,12 @@ It is important to the project that we have benchmarks in place to evaluate the
171
171
7. In `BenchmarkId` include the values used to parametrize the benchmark. For example if we're doing Pls then we may have something like `Canonical-Nipals-5feats-1_000samples`
172
172
8. Pass data as an argument to the function being benched. This will prevent Criterion from including data creation time as part of the benchmark.
173
173
9. Add a profiler see [here](https://github.com/tikv/pprof-rs#integrate-with-criterion) for an example on how to do so with pprof, Criterion, and Flamegraph.
174
+
10. Use the `benchmarks` feature of the linfa crate to configure your benchmark groups and profiler. See the bench in linfa-pls as an example of this. In most cases you can just copy and paste the configuration portions of the code. If other configurations are desired it is still easily customizable and explained in the pprof and Criterion documentations.
175
+
176
+
Feel free to use the pls bench as a guideline. Note that it uses the config::set_default_benchmark_configs and config::get_default_profiling_configs functions to configure benchmarking and profiling respectively.
174
177
175
178
### Running Benchmarks
176
-
When running benchmarks sometimes you will want to profile the code execution. Assuming you have followed step 9 to add a pprof profiling hook for the linfa-ica package you can run the following to get your profiling results as a flamegraph.
179
+
When running benchmarks sometimes you will want to profile the code execution. Assuming you have followed step 9 to add a pprof profiling hook for the linfa-ica package you can run the following to get your profiling results as a flamegraph. Be advised that at the time of writing this profiling will not work on Windows machines.
0 commit comments