diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:25:56 +0000 |
commit | 018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch) | |
tree | a835ebdf2088ef88fa681f8fad45f09922c1ae9a /src/tools/cargo/benches/README.md | |
parent | Adding debian version 1.75.0+dfsg1-5. (diff) | |
download | rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/benches/README.md')
-rw-r--r-- | src/tools/cargo/benches/README.md | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/tools/cargo/benches/README.md b/src/tools/cargo/benches/README.md index b4b8b190a..900bf084c 100644 --- a/src/tools/cargo/benches/README.md +++ b/src/tools/cargo/benches/README.md @@ -9,7 +9,23 @@ cd benches/benchsuite cargo bench ``` -The tests involve downloading the index and benchmarking against some +However, running all benchmarks would take many minutes, so in most cases it +is recommended to just run the benchmarks relevant to whatever section of code +you are working on. + +## Benchmarks + +There are several different kinds of benchmarks in the `benchsuite/benches` directory: + +* `global_cache_tracker` — Benchmarks saving data to the global cache tracker + database using samples of real-world data. +* `resolve` — Benchmarks the resolver against simulations of real-world workspaces. +* `workspace_initialization` — Benchmarks initialization of a workspace + against simulations of real-world workspaces. + +### Resolve benchmarks + +The resolve benchmarks involve downloading the index and benchmarking against some real-world and artificial workspaces located in the [`workspaces`](workspaces) directory. @@ -21,7 +37,7 @@ faster. You can (and probably should) specify individual benchmarks to run to narrow it down to a more reasonable set, for example: ```sh -cargo bench -- resolve_ws/rust +cargo bench -p benchsuite --bench resolve -- resolve_ws/rust ``` This will only download what's necessary for the rust-lang/rust workspace @@ -29,7 +45,24 @@ This will only download what's necessary for the rust-lang/rust workspace about a minute). To get a list of all the benchmarks, run: ```sh -cargo bench -- --list +cargo bench -p benchsuite --bench resolve -- --list +``` + +### Global cache tracker + +The `global_cache_tracker` benchmark tests saving data to the global cache +tracker database using samples of real-world data. This benchmark should run +relatively quickly. + +The real-world data is based on a capture of my personal development +environment which has accumulated a large cache. So it is somewhat arbitrary, +but hopefully representative of a challenging environment. Capturing of the +data is done with the `capture-last-use` binary, which you can run if you need +to rebuild the database. Just try to run on a system with a relatively full +cache in your cargo home directory. + +```sh +cargo bench -p benchsuite --bench global_cache_tracker ``` ## Viewing reports |