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
Review URL: https://codereview.chromium.org/1046363002
Cr-Commit-Position: refs/heads/master@{#325576}
CrOS-Libchrome-Original-Commit: f58961749a980032241fe6c3fc829ac2e6652030
3 files changed