Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Issue 2977783002: [tracing] Optimize StackFrameDeduplicator. (Closed)

Created:
3 years, 5 months ago by DmitrySkiba
Modified:
3 years, 5 months ago
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[tracing] Optimize StackFrameDeduplicator. Profiling StackFrameDeduplicator with new heap format revealed that: 1. At least 60% of all insertions are hits, i.e. they insert backtraces that already exist. 2. There can be as many as 500K frames. 3. The average child count at each level is ~1.2. This CL optimizes StackFrameDeduplicator based on that data: 1. Adds a hash-based backtrace lookup to cut down number of lookups in FrameNode::children maps. 2. Changes FrameNode storage from std::vector to std::deque, avoiding costly vector reallocations. 3. Changes FrameNode::children storage from std::map to std::flat_map. These changes improve HeapProfilerPerfTest.DeduplicateStackFrames perftest ~1.6x on macOS (1040ms -> 620ms), but real-world impact should be higher because the perftest is pessimistic. BUG=739378 Review-Url: https://codereview.chromium.org/2977783002 Cr-Commit-Position: refs/heads/master@{#487015} Committed: https://chromium.googlesource.com/chromium/src/+/3de608576703311817c69a8a64bdbc4feb87519b

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add comments #

Total comments: 1

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Patch Set 5 : summary -> hash #

Patch Set 6 : Don't use ASSERT_EQ on deque iterators (see goo.gl/9gkBf7) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -18 lines) Patch
M base/trace_event/heap_profiler_stack_frame_deduplicator.h View 1 3 chunks +18 lines, -6 lines 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator.cc View 1 2 3 4 5 chunks +64 lines, -7 lines 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc View 1 2 3 4 5 5 chunks +5 lines, -5 lines 0 comments Download
M base/trace_event/memory_usage_estimator.h View 3 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (13 generated)
DmitrySkiba
3 years, 5 months ago (2017-07-12 02:54:34 UTC) #2
Primiano Tucci (use gerrit)
Can you plz add some comments? The code itself looks good, but I have no ...
3 years, 5 months ago (2017-07-12 15:31:14 UTC) #3
DmitrySkiba
On 2017/07/12 15:31:14, Primiano Tucci wrote: > Can you plz add some comments? The code ...
3 years, 5 months ago (2017-07-13 00:15:15 UTC) #4
Primiano Tucci (use gerrit)
Cool LGTM. would be great to land the perftests first to see the bump :) ...
3 years, 5 months ago (2017-07-13 17:47:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2977783002/80001
3 years, 5 months ago (2017-07-14 02:07:49 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_tsan_rel_ng/builds/116261)
3 years, 5 months ago (2017-07-14 02:59:21 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2977783002/100001
3 years, 5 months ago (2017-07-16 15:08:43 UTC) #17
commit-bot: I haz the power
3 years, 5 months ago (2017-07-16 17:46:25 UTC) #21
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/3de608576703311817c69a8a64bd...

Powered by Google App Engine
This is Rietveld 408576698