From 482622c77d30fb8b4f2ec871ab476bce6dbcf7a7 Mon Sep 17 00:00:00 2001 From: ira Date: Thu, 26 May 2022 20:31:39 +0200 Subject: [PATCH 1/4] Update profiling.md --- docs/profiling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/profiling.md b/docs/profiling.md index 7894cb7b1f953..98d027b6dc491 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -52,6 +52,6 @@ After closing your app, an interactive `svg` file will be produced: ## Project Compile Times -This requires nightly rust (`rustup default nightly`). Append ```-Ztimings``` to your app's cargo command (ex: `cargo build -Ztimings`). If you want a "full" profile, make sure you run `cargo clean` first. Open the produced `cargo-timing.html` file in your browser of choice. This will show how much time each crate in your app's dependency tree took to build. +Append ```--timings``` to your app's cargo command (ex: `cargo build --timings`). If you want a "full" profile, make sure you run `cargo clean` first. Open the produced `cargo-timing.html` file in your browser of choice. This will show how much time each crate in your app's dependency tree took to build. ![image](https://user-images.githubusercontent.com/2694663/141657811-f4e15e3b-c9fc-491b-9313-236fd8c01288.png) From 740de51688510b51a9c00442790d6503fe7c55eb Mon Sep 17 00:00:00 2001 From: devil-ira Date: Thu, 26 May 2022 23:07:00 +0200 Subject: [PATCH 2/4] Remove unnecessary backticks --- docs/profiling.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/profiling.md b/docs/profiling.md index 98d027b6dc491..f4ee9da21d715 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -44,14 +44,14 @@ This approach requires no extra instrumentation and shows finer-grained flame gr Install [cargo-flamegraph](https://github.com/killercup/cargo-flamegraph), [enable debug symbols in your release build](https://github.com/killercup/cargo-flamegraph#improving-output-when-running-with---release), then run your app using one of the following commands. Note that `cargo-flamegraph` forwards arguments to cargo. You should treat the `cargo-flamegraph` command as a replacement for `cargo run --release`. The commands below include `--example EXAMPLE_NAME` to illustrate, but you can remove those arguments in favor of whatever you use to run your app: -* Graph-Like Flame Graph: ```RUSTFLAGS='-C force-frame-pointers=y' cargo flamegraph -c "record -g" --example EXAMPLE_NAME``` -* Flat-ish Flame Graph: ```RUSTFLAGS='-C force-frame-pointers=y' cargo flamegraph --example EXAMPLE_NAME``` +* Graph-Like Flame Graph: `RUSTFLAGS='-C force-frame-pointers=y' cargo flamegraph -c "record -g" --example EXAMPLE_NAME` +* Flat-ish Flame Graph: `RUSTFLAGS='-C force-frame-pointers=y' cargo flamegraph --example EXAMPLE_NAME` After closing your app, an interactive `svg` file will be produced: ![image](https://user-images.githubusercontent.com/2694663/141657609-0089675d-fb6a-4dc4-9a59-871e95e31c8a.png) ## Project Compile Times -Append ```--timings``` to your app's cargo command (ex: `cargo build --timings`). If you want a "full" profile, make sure you run `cargo clean` first. Open the produced `cargo-timing.html` file in your browser of choice. This will show how much time each crate in your app's dependency tree took to build. +Append `--timings` to your app's cargo command (ex: `cargo build --timings`). If you want a "full" profile, make sure you run `cargo clean` first. Open the produced `cargo-timing.html` file in your browser of choice. This will show how much time each crate in your app's dependency tree took to build. ![image](https://user-images.githubusercontent.com/2694663/141657811-f4e15e3b-c9fc-491b-9313-236fd8c01288.png) From 58533d8ceeb8a8a2a250dad58d46e0f021b34dd9 Mon Sep 17 00:00:00 2001 From: devil-ira Date: Mon, 30 May 2022 20:12:45 +0200 Subject: [PATCH 3/4] Add more info --- docs/profiling.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/profiling.md b/docs/profiling.md index f4ee9da21d715..954a967537beb 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -52,6 +52,11 @@ After closing your app, an interactive `svg` file will be produced: ## Project Compile Times -Append `--timings` to your app's cargo command (ex: `cargo build --timings`). If you want a "full" profile, make sure you run `cargo clean` first. Open the produced `cargo-timing.html` file in your browser of choice. This will show how much time each crate in your app's dependency tree took to build. +Append `--timings` to your app's cargo command (ex: `cargo build --timings`). +If you want a "full" profile, make sure you run `cargo clean` first (note: this will clear previously generated reports). +The command will tell you where it saved the report, which will be in your target directory under `cargo-timings/`. +The report is a `.html` file and can be opened and viewed in your browser. +This will show how much time each crate in your app's dependency tree took to build. + ![image](https://user-images.githubusercontent.com/2694663/141657811-f4e15e3b-c9fc-491b-9313-236fd8c01288.png) From 9d363f7f261172e06d52476aa44b7dea4d239df5 Mon Sep 17 00:00:00 2001 From: ira Date: Mon, 30 May 2022 22:57:04 +0200 Subject: [PATCH 4/4] Update docs/profiling.md Co-authored-by: Alice Cecile --- docs/profiling.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/profiling.md b/docs/profiling.md index 954a967537beb..d33f15feab6e8 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -58,5 +58,4 @@ The command will tell you where it saved the report, which will be in your targe The report is a `.html` file and can be opened and viewed in your browser. This will show how much time each crate in your app's dependency tree took to build. - ![image](https://user-images.githubusercontent.com/2694663/141657811-f4e15e3b-c9fc-491b-9313-236fd8c01288.png)