Struct ra_ap_profile::CpuSpan [−][src]
A wrapper around google_cpu_profiler.
Usage:
- Install gpref_tools (https://github.com/gperftools/gperftools), probably packaged with your Linux distro.
- Build with
cpu_profiler
feature. - Tun the code, the raw output would be in the
./out.profile
file. - Install pprof for visualization (https://github.com/google/pprof).
- Bump sampling frequency to once per ms:
export CPUPROFILE_FREQUENCY=1000
- 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:
$ 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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CpuSpan
impl Send for CpuSpan
impl Sync for CpuSpan
impl Unpin for CpuSpan
impl UnwindSafe for CpuSpan
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,