Profiling
Compiling oxlint in release mode with debug information
QUERY LENGTH LIMIT EXCEEDED. MAX ALLOWED QUERY : 500 CHARS
bash
cargo build --profile release-with-debug --bin oxlint
`````````bash
samply record --rate 10000 ./target/release-with-debug/oxlint --silent --threads 1 .
`````````bash
xcrun xctrace record --template 'Time Profile' --output . --launch -- /path/to/oxc/target/release-with-debug/oxlint
`````````toml
[dependencies]
dhat = "0.3"
`````````rust
fn main() {
let _profiler = dhat::Profiler::new_heap();
// Your code here - all heap allocations will be tracked
}
`````````rust
struct MyApp {
profiler: Option<dhat::Profiler>,
// other fields
}
impl MyApp {
fn close(&mut self) {
// Drop the profiler here to capture the heap state before cleanup
self.profiler = None;
// cleanup code
}
}