mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #5307
5307: disable profiling r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
0366a85052
1 changed files with 6 additions and 1 deletions
|
@ -66,7 +66,8 @@ impl Drop for Scope {
|
|||
/// 2. Build with `cpu_profiler` feature.
|
||||
/// 3. Tun the code, the *raw* output would be in the `./out.profile` file.
|
||||
/// 4. Install pprof for visualization (https://github.com/google/pprof).
|
||||
/// 5. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results.
|
||||
/// 5. Bump sampling frequency to once per ms: `export CPUPROFILE_FREQUENCY=1000`
|
||||
/// 6. Use something like `pprof -svg target/release/rust-analyzer ./out.profile` to see the results.
|
||||
///
|
||||
/// For example, here's how I run profiling on NixOS:
|
||||
///
|
||||
|
@ -74,6 +75,10 @@ impl Drop for Scope {
|
|||
/// $ nix-shell -p gperftools --run \
|
||||
/// 'cargo run --release -p rust-analyzer -- parse < ~/projects/rustbench/parser.rs > /dev/null'
|
||||
/// ```
|
||||
///
|
||||
/// See this diff for how to profile completions:
|
||||
///
|
||||
/// https://github.com/rust-analyzer/rust-analyzer/pull/5306
|
||||
#[derive(Debug)]
|
||||
pub struct CpuProfiler {
|
||||
_private: (),
|
||||
|
|
Loading…
Reference in a new issue