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

Issue 1007283012: Provide CommandLine::HasSwitch(const char*) to save 76kB in sizes perf (Closed)

Created:
5 years, 9 months ago by tapted
Modified:
5 years, 8 months ago
Reviewers:
Nico
CC:
chromium-reviews, erikwright+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Provide CommandLine::HasSwitch(const char*) to save 76kB in sizes perf Currently every callsite to CommandLine::HasSwitch() has to generate code to allocate a string on the stack, malloc(), copy characters from the switch constant, and then free things when it goes out of scope. Testing on a Mac release build, this results in about 76kB of generated object code. (about 40 bytes for each of the ~1928 calls in the non-test codebase). Adding a char[] overload allows this codegen to happen only once. And there's no lost inlining benefit since the new overload can inline its call instead. BUG=468184 Committed: https://crrev.com/009a1dc860942184fc6abdb4bedf854b15da7d91 Cr-Commit-Position: refs/heads/master@{#322737}

Patch Set 1 #

Patch Set 2 : Use StringToLowerASCII, fix tests #

Patch Set 3 : skip the case optimization #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -0 lines) Patch
M base/command_line.h View 1 chunk +3 lines, -0 lines 1 comment Download
M base/command_line.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
tapted
Hi Nico, wdyt? https://codereview.chromium.org/1007283012/diff/80001/base/command_line.h File base/command_line.h (right): https://codereview.chromium.org/1007283012/diff/80001/base/command_line.h#newcode145 base/command_line.h:145: // (Switch names are case-insensitive). This ...
5 years, 9 months ago (2015-03-18 08:51:45 UTC) #4
Nico
lgtm (say const char*, not const char[] tho) I thought I remembered some discussion on ...
5 years, 9 months ago (2015-03-19 04:51:54 UTC) #5
Nico
lgtm (say const char*, not const char[] tho) I thought I remembered some discussion on ...
5 years, 9 months ago (2015-03-19 04:53:52 UTC) #6
jackhou1
On 2015/03/19 04:53:52, Nico (traveling) wrote: > lgtm (say const char*, not const char[] tho) ...
5 years, 9 months ago (2015-03-19 05:59:19 UTC) #7
tapted
On 2015/03/19 05:59:19, jackhou1 wrote: > On 2015/03/19 04:53:52, Nico (traveling) wrote: > > lgtm ...
5 years, 9 months ago (2015-03-19 12:32:52 UTC) #8
Nico
On 2015/03/19 05:59:19, jackhou1 wrote: > On 2015/03/19 04:53:52, Nico (traveling) wrote: > > lgtm ...
5 years, 9 months ago (2015-03-19 15:07:43 UTC) #9
tapted
On 2015/03/19 12:32:52, tapted wrote: > On 2015/03/19 05:59:19, jackhou1 wrote: > > On 2015/03/19 ...
5 years, 8 months ago (2015-03-29 23:18:54 UTC) #10
tapted
On 2015/03/29 23:18:54, tapted wrote: > And, since it's quiet, now *would* be a good ...
5 years, 8 months ago (2015-03-30 02:07:42 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1007283012/80001
5 years, 8 months ago (2015-03-30 02:08:14 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:80001)
5 years, 8 months ago (2015-03-30 03:57:20 UTC) #14
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/009a1dc860942184fc6abdb4bedf854b15da7d91 Cr-Commit-Position: refs/heads/master@{#322737}
5 years, 8 months ago (2015-03-30 03:57:49 UTC) #15
tapted
On 2015/03/19 12:32:52, tapted wrote: > and keep an eye on sizes > perf to ...
5 years, 8 months ago (2015-03-30 05:12:45 UTC) #16
Nico
5 years, 8 months ago (2015-03-30 18:44:46 UTC) #17
Message was sent while issue was closed.
Thanks for filing the size issues!

( :-( )

On Sun, Mar 29, 2015 at 7:07 PM, <tapted@chromium.org> wrote:

> On 2015/03/29 23:18:54, tapted wrote:
>
>> And, since it's quiet, now *would* be a good time to commit this.. except
>> the
>> sizes bots are currently offline -
>>
> http://build.chromium.org/p/chromium/console
>
>> returns 500. I'll see if there's something I can do to fix that, otherwise
>>
> this
>
>> will have to wait a little bit longer.
>>
>
> So actually the bots and perf graphs are fine, it's just the buildbot webui
> that's failing to scrape the data.
>
> I verified this on the perf graphs, and checked on the baselines. Turns
> out...
> sizes regressions of 1528kB (filed http://crbug.com/471609 - mac only)
> and 320kB
> (filed http://crbug.com/471610) had recently crept in - wow.
>
> I'll go ahead with this CL while it's quiet (this week... is unlikely to
> get
> quiet again :/), and make sure the perf graphs agree with me.
>
> https://codereview.chromium.org/1007283012/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698