Catching panics is eating into Servo's DOM performance #34727
Closed
Description
I have a profile showing that of 60% of execution time spent under a Rust callback from SpiderMonkey that corresponds to invoking a method on a JS object inside of a hot loop, fully half of that time is spent inside __rust_try, __rust_maybe_catch_panic, and std::panicking::PANIC_COUNT::__getit. Since we go Rust -> C++ -> JS -> C++ -> Rust when executing JS that invokes a DOM method, every loop iteration we call catch_unwind in the Rust callbacks invoked by C. This appears to be impacting our potential maximum performance significantly.
Issues to solve
- Use only one personality function - Use only one personality function instead of 2 on Unix #34786
- Inline cross-crate thread-local access - Access to thread locals isn't inlined across crates #25088
- Don't hit TLS when entering catch_unwind - Don't hit thread-local-storage when entering
catch_unwind
#34787
Metadata
Assignees
Labels
Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsCategory: An issue proposing an enhancement or a PR with one.Issue: Problems and improvements with respect to performance of generated code.Relevant to the library API team, which will review and decide on the PR/issue.