Descriptiontracing: 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 #
Messages
Total messages: 13 (9 generated)
|