aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_prof/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-11 02:42:18 +0100
committerGitHub <[email protected]>2020-07-11 02:42:18 +0100
commit0366a85052904c5c6efa3b3ecddc35dce85337c4 (patch)
tree4baab51c3a82e30fc6fc32099d0315e44efce6d4 /crates/ra_prof/src/lib.rs
parenta3edd482e9fc6b970df8cd024addd94b29f3f4e9 (diff)
parent7f6e5de37c3c5a73865350cab1c976291be56fe2 (diff)
Merge #5307
5307: disable profiling r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_prof/src/lib.rs')
-rw-r--r--crates/ra_prof/src/lib.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs
index 0fb468375..7163a8424 100644
--- a/crates/ra_prof/src/lib.rs
+++ b/crates/ra_prof/src/lib.rs
@@ -66,7 +66,8 @@ impl Drop for Scope {
66/// 2. Build with `cpu_profiler` feature. 66/// 2. Build with `cpu_profiler` feature.
67/// 3. Tun the code, the *raw* output would be in the `./out.profile` file. 67/// 3. Tun the code, the *raw* output would be in the `./out.profile` file.
68/// 4. Install pprof for visualization (https://github.com/google/pprof). 68/// 4. Install pprof for visualization (https://github.com/google/pprof).
69/// 5. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results. 69/// 5. Bump sampling frequency to once per ms: `export CPUPROFILE_FREQUENCY=1000`
70/// 6. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results.
70/// 71///
71/// For example, here's how I run profiling on NixOS: 72/// For example, here's how I run profiling on NixOS:
72/// 73///
@@ -74,6 +75,10 @@ impl Drop for Scope {
74/// $ nix-shell -p gperftools --run \ 75/// $ nix-shell -p gperftools --run \
75/// 'cargo run --release -p rust-analyzer -- parse < ~/projects/rustbench/parser.rs > /dev/null' 76/// 'cargo run --release -p rust-analyzer -- parse < ~/projects/rustbench/parser.rs > /dev/null'
76/// ``` 77/// ```
78///
79/// See this diff for how to profile completions:
80///
81/// https://github.com/rust-analyzer/rust-analyzer/pull/5306
77#[derive(Debug)] 82#[derive(Debug)]
78pub struct CpuProfiler { 83pub struct CpuProfiler {
79 _private: (), 84 _private: (),