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

Issue 815543002: Avoid a string copy for every CommandLine::HasSwitch query (Closed)

Created:
6 years ago by jdduke (slow)
Modified:
6 years ago
Reviewers:
Lei Zhang
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid a string copy for every CommandLine::HasSwitch query Windows performs a lower-case conversion of all strings passed to CommandLine::HasSwitch. Other platforms require no such conversion, however, currently they pay for an associated string copy on each query. Why? Because compilers aren't as smart as they should be. Remove this string copy for non-Windows platforms. A string copy saved is a string copy earned. BUG=405348 Committed: https://crrev.com/034cff8362b7fe30be88b9e344544be486bae74c Cr-Commit-Position: refs/heads/master@{#308839}

Patch Set 1 #

Patch Set 2 : Undo line removal #

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

Messages

Total messages: 7 (2 generated)
jdduke (slow)
thestig@: PTAL. I was surprised, but both GCC/Clang aren't smart enough to elide the string ...
6 years ago (2014-12-17 17:51:48 UTC) #2
Lei Zhang
lgtm
6 years ago (2014-12-17 19:17:41 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/815543002/20001
6 years ago (2014-12-17 19:20:45 UTC) #5
commit-bot: I haz the power
Committed patchset #2 (id:20001)
6 years ago (2014-12-17 19:35:25 UTC) #6
commit-bot: I haz the power
6 years ago (2014-12-17 19:36:15 UTC) #7
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/034cff8362b7fe30be88b9e344544be486bae74c
Cr-Commit-Position: refs/heads/master@{#308839}

Powered by Google App Engine
This is Rietveld 408576698