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

Issue 2857543002: tracing: Simplify TraceEventMemoryOverhead, use an enum insted of a map (Closed)

Created:
3 years, 7 months ago by Primiano Tucci (use gerrit)
Modified:
3 years, 7 months ago
Reviewers:
hjd
CC:
chromium-reviews, tracing+reviews_chromium.org, wfh+watch_chromium.org, danakj+watch_chromium.org, vmpstr+watch_chromium.org, ssid, etienneb
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

tracing: Simplify TraceEventMemoryOverhead, use an enum insted of a map TraceEventMemoryOverhead is a rather simple class which only purpose is accounting various sources of memory overhead due to tracing itself. For debugging purposes it keeps track of the actual class causing overhead, so that they can be inspected distinctly in the tracing UI The current implementation was using a small_map indexed by const char* pointer, which has a bunch of problems: - base::small_map can degenerate into a STL map when exceeding the inline capacity, which in turn can cause some extra impredictability, see "[chromium-dev] Please avoid std::unordered_map". - The map implicitly assumes that two identical string literals will have identical pointers, which is not true, esepcially in component builds. - Any sort of map is a really over-engineered solution, given that the sources of overheads we care about are known a priori and are a manageable number. Hence, this CL is switching the implementation of TraceEventMemoryOverhead to be just enum-base, which ditches completely the map. BUG=717223 Review-Url: https://codereview.chromium.org/2857543002 Cr-Commit-Position: refs/heads/master@{#468611} Committed: https://chromium.googlesource.com/chromium/src/+/eb6696a1bfb1c32c6d2d1baf9a0dabcc632119e7

Patch Set 1 #

Patch Set 2 : Fix compiler issues + omit empty values #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -80 lines) Patch
M base/trace_event/heap_profiler_allocation_register.cc View 1 chunk +2 lines, -1 line 0 comments Download
M base/trace_event/heap_profiler_stack_frame_deduplicator.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/heap_profiler_type_name_deduplicator.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_buffer.cc View 4 chunks +7 lines, -5 lines 0 comments Download
M base/trace_event/trace_event_argument.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_event_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/trace_event/trace_event_memory_overhead.h View 4 chunks +27 lines, -13 lines 0 comments Download
M base/trace_event/trace_event_memory_overhead.cc View 1 4 chunks +78 lines, -55 lines 0 comments Download
M base/trace_event/trace_log.cc View 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (9 generated)
Primiano Tucci (use gerrit)
hjd: can you take a look plz? +ssid/etienneb FYI, I suspect this should indirectly resolve ...
3 years, 7 months ago (2017-05-02 10:19:55 UTC) #4
hjd
On 2017/05/02 10:19:55, Primiano Tucci wrote: > hjd: can you take a look plz? > ...
3 years, 7 months ago (2017-05-02 10:46:30 UTC) #7
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/2857543002/20001
3 years, 7 months ago (2017-05-02 11:12:53 UTC) #10
commit-bot: I haz the power
3 years, 7 months ago (2017-05-02 13:01:27 UTC) #13
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/eb6696a1bfb1c32c6d2d1baf9a0d...

Powered by Google App Engine
This is Rietveld 408576698