Skip to content

Deploy Dec 5, 2023#4832

Merged
julienw merged 63 commits into
productionfrom
main
Dec 5, 2023
Merged

Deploy Dec 5, 2023#4832
julienw merged 63 commits into
productionfrom
main

Conversation

@julienw

@julienw julienw commented Dec 5, 2023

Copy link
Copy Markdown
Contributor

Important performance changes:
[Markus Stange] Replace child count with "has children" (Merge PR #4829)
[Markus Stange] Reduce the time of switching to the stack chart tab for the first time (Merge PR #4825)
[Markus Stange] Speed up getCallNodeInfo (#4826)
[Markus Stange] Improve flame graph performance. (Merge PR #4820)
[Markus Stange] Improve findHeavyPathToSameFunctionAfterInversion. (Merge PR #4813)
[Markus Stange] Optimize call node table traversals (Merge PR #4807)
[Markus Stange] Make traced durations honor the preview selection. (Merge PR #4817)
[Markus Stange] Use a call node path to make the stack copy string. (Merge PR #4811)
[Markus Stange] Simplify heightFunction. (Merge PR #4810)
[Markus Stange] Stop using sampleCallNodes in ThreadSampleGraph. (Merge PR #4809)
[Markus Stange] Only set fillStyle once in drawSamples. (Merge PR #4816)
[Markus Stange] Make the flame graph and stack chart always non-inverted (Merge PR #4804)

mstange and others added 30 commits November 23, 2023 15:38
Compute the inverted selected call node in the action creator,
not in the reducer. This means we don't have to pass the call tree as
far down.

Also move the computation into the CallTree class.

And fix it to stop at nodes with heaviest self time, even if they're not
leaf nodes.
This means that the flame graph and the stack chart will now always display un-inverted.

Fixes #3961.
Fixes #4803.
This makes it faster to switch back and forth between inverted and non-inverted mode.
It also makes it faster to switch tabs between inverted call tree and the chart views
which are always non-inverted.
Pass it just the sample index, and have it return the depth.
The yPixelsPerHeight multiplication can happen in the caller.
This is a minor simplification and removes some raw callNodeTable usage.
Move the fillStyle setting outside of a loop in the SampleGraph implementation.
This was likely moved by mistake in f8631ae .

And don't set the fillStyle at all if there's nothing to draw with this color.
This will be used to make various uses of the call node table more
efficient.
mstange and others added 29 commits November 28, 2023 00:21
This is a bit faster because we don't need to create children arrays
and sort them. It also fixes a bug with diff profiles. (Test coming
up in the next commit.)
In the past, the indexes would be incorrect for the diffed thread
because we were using the dict for one of the input threads, which
has a different funcTable.
Before: https://share.firefox.dev/47ydcmp
After: https://share.firefox.dev/40Y48og

Fixes #844.

The old code was saving time by sorting siblings only for the nodes that
were displayed based on the current (preview) range selection. This made
it cheaper to compute the flame graph for a small range, but it meant
that we had to re-do the sort every time the selection changed.

Now we do the sorting once, based on the entire call node table. This is
expensive but it is a one-time cost (and it's still cheaper than if you
were looking at the entire call tree with the old implementation).
Then we cache the "ordered rows" and don't have to sort again on each
range selection change.
…astChild instead of a Map to find existing call nodes with the same prefix and func.
Rather than talking about "0-based" and "1-based" depths, I think it would
be less confusing to always treat depths as zero-based and rename these variables.
When I was reading the stack chart code, I was initially quite confused because we
were creating an array with length maxDepth, and that seemed too short.
…r-row arrays in computeFlameGraphRows.

We don't use computeCallNodeMaxDepthPlusOne here because that one would only
include the depth of call nodes that are used by any of the filtered samples.
But computeFlameGraphRows looks at the entire call node table, and needs to
reserve enough rows to have space even for call nodes which aren't used by
any samples.
Bumps [@adobe/css-tools](https://github.com/adobe/css-tools) from 4.3.1 to 4.3.2.
- [Changelog](https://github.com/adobe/css-tools/blob/main/History.md)
- [Commits](https://github.com/adobe/css-tools/commits)

---
updated-dependencies:
- dependency-name: "@adobe/css-tools"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
We no longer need the child count, because the call tree's getChildren()
method now uses nextSibling to find the children, so it doesn't need the
child count any more for ending the search early.
And the new flame graph implementation has dropped the other use of the
child count.

Having just one byte per call node rather than four bytes might improve
the performance of computeCallTreeCountsAndSummary slightly, because it
needs to touch fewer bytes in memory.
This avoids calls to getChildren for nodes which are visible but not expanded.
The tree view calls hasChildren in order to determine whether to show the
disclosure arrow.
Avoiding the call to getChildren means that we don't have to allocate the
array and sort it. This is especially useful in the inverted tree, which
has lots of non-expanded nodes at the root level.
@julienw julienw merged commit f553df1 into production Dec 5, 2023
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.

3 participants