diff options
| author | Teresa Johnson <tejohnson@google.com> | 2024-07-23 12:44:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-23 12:44:06 -0700 |
| commit | 055e4319112282354327af9908091fdb25149e9b (patch) | |
| tree | be6038746a0a9ef3c79028518758d98f742c9195 /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface | |
| parent | 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43 (diff) | |
[MemProf] Reduce cloning overhead by sharing nodes when possible (#99832)
When assigning calls to nodes while building the graph, we can share
nodes between multiple calls in some cases. Specifically, when we
process the list of calls that had the same stack ids (possibly pruned,
because we are looking at the stack ids that actually had nodes in the
graph due to stack ids in the pruned allocation MIBs), for calls that
are located in the same function, we know that they will behave exactly
the same through cloning and function assignment. Therefore, instead of
creating nodes for all of them (requiring context id duplication), keep
a list of additional "matching calls" on the nodes. During function
assignment we simply update all the matching calls the same way as the
primary call.
This change not only reduces the number of nodes (both original and
cloned), but also greatly reduces the number of duplicated context ids
and the time to propagate them.
For a large target, I measured a 25% peak memory reduction and 42% time
reduction.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedProcessPythonInterface')
0 files changed, 0 insertions, 0 deletions
