diff options
Diffstat (limited to 'manual/src/profiling.md')
-rw-r--r-- | manual/src/profiling.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/manual/src/profiling.md b/manual/src/profiling.md index 00ad6c21f..e9ca911ce 100644 --- a/manual/src/profiling.md +++ b/manual/src/profiling.md @@ -5,22 +5,22 @@ If you have a file that's particularly slow, you can use which functions are slow. ``` -$ CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin difft sample_files/slow_before.rs sample_files/slow_after.rs +$ CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --bin difft sample_files/slow_1.rs sample_files/slow_2.rs ``` It's also worth looking at memory usage, as graph traversal bugs can lead to huge memory consumption. ``` -$ /usr/bin/time -v ./target/release/difft sample_files/slow_before.rs sample_files/slow_after.rs +$ /usr/bin/time -v ./target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs ``` If timing measurement are noisy, Linux's `perf` tool will report instructions executed, which is more stable. ``` -$ perf stat ./target/release/difft sample_files/slow_before.rs sample_files/slow_after.rs -$ perf stat ./target/release/difft sample_files/typing_old.ml sample_files/typing_new.ml +$ perf stat ./target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs +$ perf stat ./target/release/difft sample_files/typing_1.ml sample_files/typing_2.ml ``` Many more profiling techniques are discussed in [The Rust Performance |