firefox-devtools / firefox-devtools/profiler
Slow dispatch() during symbolication - 8 seconds of 100% CPU usage checking selectors
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 30
Description
Profile: https://share.firefox.dev/41V11ym
Profile with JS execution tracer (short excerpt): https://share.firefox.dev/4hKqDnz
I was loading and symbolicating this profile with `samply load perf.data`: https://share.firefox.dev/4iYLfJN
During symbolication, the same 21 tracks were visible which are visible when you open the uploaded profile.
The profile has 360 libs that need to be symbolicated. `requestSymbolsWithCallback` does one call to `dispatch(requestingSymbolTable(lib))` for each of the 360 libs. And each of those `dispatch` calls appears to take a full 10ms! That means 3.6 seconds of CPU usage for dispatching all these `requestingSymbolTable` actions! And another 3.6 seconds once the results have come in.
10ms per dispatch is too much. All the time is spent checking whether we need to re-run selectors.
I haven't dug into which selectors we're checking and how many times which level is being checked.
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-886)
Contributor guide
Assessment
This issue has not been assessed yet.