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

Issue 1181293005: Optimize memory use of registered histograms. (Closed)

Created:
5 years, 6 months ago by Alexei Svitkine (slow)
Modified:
5 years, 6 months ago
Reviewers:
Ilya Sherman
CC:
chromium-reviews, erikwright+watch_chromium.org, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Optimize memory use of registered histograms. Prior to this change, all histogram names would be stored twice - once in each Histogram object and another time as the key of the histograms map. This change eliminates the second copy by making the map key be a reference to the name string within the Histogram object. In my local testing, this saved about 35k of memory in the browser process and around 2k-4k in each sub-process. BUG=500619 Committed: https://crrev.com/33d9fd6321af0d2905adb9f5168d853e3b45248c Cr-Commit-Position: refs/heads/master@{#334481}

Patch Set 1 #

Patch Set 2 : Remove code to print size. #

Patch Set 3 : Improve comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -7 lines) Patch
M base/metrics/histogram_base.h View 1 chunk +1 line, -1 line 0 comments Download
M base/metrics/statistics_recorder.h View 1 2 1 chunk +17 lines, -1 line 0 comments Download
M base/metrics/statistics_recorder.cc View 1 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Alexei Svitkine (slow)
5 years, 6 months ago (2015-06-15 17:19:46 UTC) #3
Ilya Sherman
LGTM. Nice find! Also, wow, 35k of memory just for a single copy of the ...
5 years, 6 months ago (2015-06-15 21:50:14 UTC) #4
Alexei Svitkine (slow)
I did measurement that too - and it was about 200k in a clean-ish profile ...
5 years, 6 months ago (2015-06-15 21:53:27 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1181293005/60001
5 years, 6 months ago (2015-06-15 21:55:28 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:60001)
5 years, 6 months ago (2015-06-15 22:36:27 UTC) #8
commit-bot: I haz the power
5 years, 6 months ago (2015-06-15 22:37:24 UTC) #9
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/33d9fd6321af0d2905adb9f5168d853e3b45248c
Cr-Commit-Position: refs/heads/master@{#334481}

Powered by Google App Engine
This is Rietveld 408576698