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

Issue 1046363002: Enforce lowercase switches when calling CommandLine::HasSwitch(const char*). (Closed)

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

Description

Enforce lowercase switches when calling CommandLine::HasSwitch. At the moment, all compile-time switches are lowercase. By enforcing this, we can skip converting it to lowercase on Windows, which saves one string allocation per call. On a profile with 2 extensions, HasSwitch is called ~12k times during startup. In an ideal situation (no paging/cache pressure), the string allocation under Windows takes ~137ns on an Xeon E5-2690 @ 2.9Ghz. So this should shave off at least 1.6ms off a typical startup with this hardware. For context, Startup.BrowserMessageLoopStartTimeFromMainEntry is typically 280-300ms on the same hardware, so we should get a ~0.5% improvement. BUG=472383 Committed: https://crrev.com/f58961749a980032241fe6c3fc829ac2e6652030 Cr-Commit-Position: refs/heads/master@{#325576} Committed: https://crrev.com/b20cbb495422e5f76f3064d73d3bb9c51113c45d Cr-Commit-Position: refs/heads/master@{#326219}

Patch Set 1 #

Patch Set 2 : Remove EXPECT_DEBUG_DEATH #

Total comments: 10

Patch Set 3 : Address comments. #

Patch Set 4 : Enforce lowercase for both versions of HasSwitch. #

Patch Set 5 : Fix test on Linux. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -7 lines) Patch
M base/command_line.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M base/command_line.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M base/command_line_unittest.cc View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 28 (7 generated)
jackhou1
tapted, could you take a look?
5 years, 8 months ago (2015-04-01 03:50:12 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1046363002/20001
5 years, 8 months ago (2015-04-02 01:26:25 UTC) #4
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/53517)
5 years, 8 months ago (2015-04-02 01:37:20 UTC) #6
tapted
https://codereview.chromium.org/1046363002/diff/20001/base/command_line.cc File base/command_line.cc (right): https://codereview.chromium.org/1046363002/diff/20001/base/command_line.cc#newcode273 base/command_line.cc:273: bool CommandLine::HasSwitch(const std::string& switch_string) const { How many times ...
5 years, 8 months ago (2015-04-02 01:46:15 UTC) #7
tapted
also, like ben said, the CL description should have some numbers in it. *ideally* some ...
5 years, 8 months ago (2015-04-02 01:50:32 UTC) #8
jackhou1
I tried running a perf benchmark, but the bot timed out, second attempt here: https://codereview.chromium.org/1056443004/ ...
5 years, 8 months ago (2015-04-02 04:51:52 UTC) #9
tapted
code lgtm CL description: "paging" is probably slightly more accurate than "swapping" -- swapping comes ...
5 years, 8 months ago (2015-04-02 05:00:23 UTC) #10
jackhou1
brettw, could you take a look?
5 years, 8 months ago (2015-04-02 05:53:20 UTC) #12
brettw
Not LGTM, this doesn't seem fully baked. But the number of calls is really shocking ...
5 years, 8 months ago (2015-04-02 18:39:35 UTC) #13
jackhou1
On 2015/04/02 18:39:35, brettw wrote: > Not LGTM, this doesn't seem fully baked. But the ...
5 years, 8 months ago (2015-04-09 06:27:01 UTC) #14
jackhou1
brettw, PTAL
5 years, 8 months ago (2015-04-13 06:54:18 UTC) #15
brettw
Sorry, I haven't gotten to this yet, will look today.
5 years, 8 months ago (2015-04-16 17:22:56 UTC) #16
brettw
lgtm
5 years, 8 months ago (2015-04-16 23:22:02 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1046363002/80001
5 years, 8 months ago (2015-04-16 23:57:52 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 8 months ago (2015-04-17 01:56:26 UTC) #21
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/f58961749a980032241fe6c3fc829ac2e6652030 Cr-Commit-Position: refs/heads/master@{#325576}
5 years, 8 months ago (2015-04-17 01:57:22 UTC) #22
yoichio
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/1091993002/ by yoichio@chromium.org. ...
5 years, 8 months ago (2015-04-17 08:27:21 UTC) #23
jackhou1
On 2015/04/17 08:27:21, yoichio wrote: > A revert of this CL (patchset #5 id:80001) has ...
5 years, 8 months ago (2015-04-22 01:18:02 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1046363002/80001
5 years, 8 months ago (2015-04-22 01:18:28 UTC) #26
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 8 months ago (2015-04-22 02:21:53 UTC) #27
commit-bot: I haz the power
5 years, 8 months ago (2015-04-22 02:23:51 UTC) #28
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/b20cbb495422e5f76f3064d73d3bb9c51113c45d
Cr-Commit-Position: refs/heads/master@{#326219}

Powered by Google App Engine
This is Rietveld 408576698