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

Issue 1195473002: Optimize size of UMA histogram macros. (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 machine code size of UMA histogram macros. Adds overloads to the histogram FactoryGet() functions that take a const char* param, instead of std::string for the name. This avoids the std::string constructor being inlined at call-sites when a C string is passed (but call sites that pass std::strings already will continue to use the std::string functions). In my Mac Release build, this change results in a 271K reduction to Chromium Framework binary size. BUG=343946 Committed: https://crrev.com/5c2d502d34ea0f162d7fc5c916b1cff9e6acb0b4 Cr-Commit-Position: refs/heads/master@{#335178}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -0 lines) Patch
M base/metrics/histogram.h View 4 chunks +40 lines, -0 lines 0 comments Download
M base/metrics/histogram.cc View 4 chunks +45 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
Alexei Svitkine (slow)
5 years, 6 months ago (2015-06-17 15:18:39 UTC) #2
Ilya Sherman
Can we use StringPiece instead of overloads?
5 years, 6 months ago (2015-06-17 22:25:38 UTC) #3
Alexei Svitkine (slow)
That would be inlining the StringPiece constructor instead of the std::string one. I suspect it ...
5 years, 6 months ago (2015-06-17 23:05:33 UTC) #4
Ilya Sherman
On 2015/06/17 23:05:33, Alexei Svitkine wrote: > That would be inlining the StringPiece constructor instead ...
5 years, 6 months ago (2015-06-17 23:30:38 UTC) #5
Alexei Svitkine (slow)
Okay, I tried using StringPiece and that resulted in 246k in savings (as opposed to ...
5 years, 6 months ago (2015-06-18 16:36:49 UTC) #6
Alexei Svitkine (slow)
(So based on the results above, I still think the overloads are a better solution. ...
5 years, 6 months ago (2015-06-18 19:01:29 UTC) #7
Ilya Sherman
On 2015/06/18 16:36:49, Alexei Svitkine wrote: > Okay, I tried using StringPiece and that resulted ...
5 years, 6 months ago (2015-06-18 21:10:04 UTC) #8
Alexei Svitkine (slow)
On Thu, Jun 18, 2015 at 5:10 PM, <isherman@chromium.org> wrote: > On 2015/06/18 16:36:49, Alexei ...
5 years, 6 months ago (2015-06-18 21:28:13 UTC) #9
Ilya Sherman
Fair enough, I suppose it's fine either way, and it's true that saving on binary ...
5 years, 6 months ago (2015-06-18 22:13:39 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1195473002/1
5 years, 6 months ago (2015-06-18 23:06:32 UTC) #13
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 6 months ago (2015-06-19 00:37:59 UTC) #14
commit-bot: I haz the power
5 years, 6 months ago (2015-06-19 00:38:46 UTC) #15
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/5c2d502d34ea0f162d7fc5c916b1cff9e6acb0b4
Cr-Commit-Position: refs/heads/master@{#335178}

Powered by Google App Engine
This is Rietveld 408576698