Skip to content

Share libs between threads#3906

Merged
mstange merged 1 commit intofirefox-devtools:mainfrom
mstange:libs-format
Mar 1, 2022
Merged

Share libs between threads#3906
mstange merged 1 commit intofirefox-devtools:mainfrom
mstange:libs-format

Conversation

@mstange
Copy link
Contributor

@mstange mstange commented Feb 22, 2022

Production
Deploy preview
(18.4MB -> 3.9MB)

This changes the processed profile format to use one global "libs" list,
rather than per-thread lists. Furthermore, we only keep libs for which we
encountered at least one frame address. Unused libs are discarded.
We also discard the libs' address ranges. Those are only used during
profile processing, to convert an absolute frame address into a library-relative
frame address.

While we're here, we also clean up the ResourceTable type and make it
use null consistently, and force all resources to have a name. Fixes #652.

During profile merging and diffing, the libs unification moves to a different
place: Rather than merging libs at the thread level, we now need to merge
them when we combine the profiles. Then, when we diff two threads from the
same profile, we no longer need to merge libs because the two threads already
use a shared libs list.

@mstange mstange requested a review from julienw February 22, 2022 20:18
@mstange mstange self-assigned this Feb 22, 2022
@codecov
Copy link

codecov bot commented Feb 22, 2022

Codecov Report

Merging #3906 (25276bf) into main (86199ec) will increase coverage by 0.04%.
The diff coverage is 92.36%.

❗ Current head 25276bf differs from pull request most recent head 3419b5c. Consider uploading reports for the commit 3419b5c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3906      +/-   ##
==========================================
+ Coverage   87.22%   87.26%   +0.04%     
==========================================
  Files         278      277       -1     
  Lines       23686    23711      +25     
  Branches     6261     6255       -6     
==========================================
+ Hits        20659    20691      +32     
+ Misses       2784     2779       -5     
+ Partials      243      241       -2     
Impacted Files Coverage Δ
src/profile-logic/call-tree.js 91.46% <0.00%> (+0.37%) ⬆️
src/profile-logic/data-structures.js 95.45% <ø> (ø)
src/profile-logic/sanitize.js 96.53% <0.00%> (ø)
src/profile-logic/merge-compare.js 90.44% <85.18%> (+0.95%) ⬆️
src/profile-logic/process-profile.js 91.15% <96.42%> (+0.29%) ⬆️
src/profile-logic/processed-profile-versioning.js 85.06% <97.22%> (+0.53%) ⬆️
src/app-logic/constants.js 100.00% <100.00%> (ø)
src/components/shared/CallNodeContextMenu.js 90.00% <100.00%> (+0.37%) ⬆️
src/components/tooltip/CallNode.js 87.50% <100.00%> (-0.15%) ⬇️
src/profile-logic/address-locator.js 100.00% <100.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86199ec...3419b5c. Read the comment docs.

Copy link
Contributor

@julienw julienw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is solid work!

This changes the processed profile format to use one global "libs" list,
rather than per-thread lists. Furthermore, we only keep libs for which we
encountered at least one frame address. Unused libs are discarded.
We also discard the libs' address ranges. Those are only used during
profile processing, to convert an absolute frame address into a library-relative
frame address.

While we're here, we also clean up the ResourceTable type and make it
use null consistently, and force all resources to have a name. Fixes firefox-devtools#652.

During profile merging and diffing, the libs unification moves to a different
place: Rather than merging libs at the thread level, we now need to merge
them when we combine the profiles. Then, when we diff two threads from the
same profile, we no longer need to merge libs because the two threads already
use a shared libs list.
@mstange mstange enabled auto-merge March 1, 2022 00:44
@mstange mstange merged commit af469ed into firefox-devtools:main Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert ResourceTable columns to not use -1 values

2 participants