mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Enable profiling for bench
This commit is contained in:
parent
b98967d765
commit
98cc51580d
3 changed files with 10 additions and 6 deletions
|
@ -26,6 +26,13 @@ pub use crate::memory_usage::{Bytes, MemoryUsage};
|
|||
#[global_allocator]
|
||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||
|
||||
pub fn init() {
|
||||
set_filter(match std::env::var("RA_PROFILE") {
|
||||
Ok(spec) => Filter::from_spec(&spec),
|
||||
Err(_) => Filter::disabled(),
|
||||
});
|
||||
}
|
||||
|
||||
/// Set profiling filter. It specifies descriptions allowed to profile.
|
||||
/// This is helpful when call stack has too many nested profiling scopes.
|
||||
/// Additionally filter can specify maximum depth of profiling scopes nesting.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue