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

Issue 747013003: Various optimizations to reduce the number of temporary allocations. (Closed)

Created:
6 years, 1 month ago by Georges Khalil
Modified:
6 years ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Various optimizations to reduce the number of temporary allocations (depends on CL753603002). - Replaced StringPrintf with multiple appends for improved performance. - Reduced the number of temporary string allocations. - Changed the algorithm by which an IDR is searched, using a standard linear search (removed the temporary set that was created). BUG= Committed: https://crrev.com/7d527ea37727f05e36ec15744d2ce7decac37ffb Cr-Commit-Position: refs/heads/master@{#306743}

Patch Set 1 : #

Total comments: 8

Patch Set 2 : Merging up to r5664 #

Patch Set 3 : Responded to comments. #

Total comments: 1

Patch Set 4 : Restored StringPrintf. #

Total comments: 1

Patch Set 5 : Restored the other StringPrintf. #

Total comments: 2

Patch Set 6 : Removed two calls to string::reserve(). #

Total comments: 10

Patch Set 7 : Responded to comments. #

Total comments: 1

Patch Set 8 : Reorganized ThemeService::HasCustomImage. #

Patch Set 9 : Added back calls to c_str that were removed by mistake. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -45 lines) Patch
M chrome/browser/extensions/api/font_settings/font_settings_api.cc View 1 2 3 4 5 6 7 8 6 chunks +8 lines, -9 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack.cc View 1 2 3 4 5 6 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/browser/themes/theme_properties.h View 1 2 3 4 5 6 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/themes/theme_properties.cc View 1 2 3 4 5 6 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -7 lines 0 comments Download
M chrome/browser/ui/prefs/prefs_tab_helper.cc View 1 2 3 4 5 6 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/theme_source.cc View 1 2 3 4 5 6 3 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 56 (22 generated)
Sigurður Ásgeirsson
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/themes/browser_theme_pack.cc#newcode103 chrome/browser/themes/browser_theme_pack.cc:103: { PRS_THEME_FRAME, IDR_THEME_FRAME, it should be easy to mandate ...
6 years ago (2014-11-25 01:37:01 UTC) #5
Georges Khalil
PTAL.
6 years ago (2014-12-01 16:13:51 UTC) #7
Nico
> Replaced StringPrintf with multiple appends for improved performance. This part does not lgtm. https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc ...
6 years ago (2014-12-01 17:05:15 UTC) #9
viettrungluu
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/themes/theme_properties.cc File chrome/browser/themes/theme_properties.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/themes/theme_properties.cc#newcode206 chrome/browser/themes/theme_properties.cc:206: return BrowserThemePack::FindThemeableImageIDRs(id); I'd call this "IsThemeableImageIDR()", rather than "Find...()". ...
6 years ago (2014-12-01 18:59:03 UTC) #11
Peter Kasting
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode92 chrome/browser/extensions/api/font_settings/font_settings_api.cc:92: pref_name->append(script); On 2014/12/01 17:05:15, Nico wrote: > This kind ...
6 years ago (2014-12-01 23:09:17 UTC) #13
Nico
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode92 chrome/browser/extensions/api/font_settings/font_settings_api.cc:92: pref_name->append(script); On 2014/12/01 23:09:17, Peter Kasting wrote: > On ...
6 years ago (2014-12-01 23:19:07 UTC) #14
Peter Kasting
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode92 chrome/browser/extensions/api/font_settings/font_settings_api.cc:92: pref_name->append(script); On 2014/12/01 23:19:06, Nico wrote: > On 2014/12/01 ...
6 years ago (2014-12-01 23:35:31 UTC) #15
cmumford
https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/60001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode92 chrome/browser/extensions/api/font_settings/font_settings_api.cc:92: pref_name->append(script); On 2014/12/01 23:35:30, Peter Kasting wrote: > On ...
6 years ago (2014-12-03 17:28:29 UTC) #17
Georges Khalil
PTAL. - Changed FindThemeableImageIDR() to IsThemeableImageIDR(). - Removed GetThemeableImageIDRs(). - The string pref_name is now ...
6 years ago (2014-12-03 19:10:08 UTC) #22
Nico
https://codereview.chromium.org/747013003/diff/180001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/180001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode94 chrome/browser/extensions/api/font_settings/font_settings_api.cc:94: registrar->Add(pref_name, callback); This still does not lgtm.
6 years ago (2014-12-03 19:14:39 UTC) #23
Georges Khalil
On 2014/12/03 19:14:39, Nico wrote: > https://codereview.chromium.org/747013003/diff/180001/chrome/browser/extensions/api/font_settings/font_settings_api.cc > File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): > > https://codereview.chromium.org/747013003/diff/180001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode94 > ...
6 years ago (2014-12-03 19:30:41 UTC) #24
Nico
On 2014/12/03 19:30:41, Georges Khalil wrote: > On 2014/12/03 19:14:39, Nico wrote: > > > ...
6 years ago (2014-12-03 19:43:04 UTC) #25
Nico
6 years ago (2014-12-03 19:43:10 UTC) #26
Georges Khalil
On 2014/12/03 19:43:04, Nico wrote: > On 2014/12/03 19:30:41, Georges Khalil wrote: > > On ...
6 years ago (2014-12-03 19:46:43 UTC) #27
Peter Kasting
On 2014/12/03 19:46:43, Georges Khalil wrote: > On 2014/12/03 19:43:04, Nico wrote: > > On ...
6 years ago (2014-12-03 20:05:17 UTC) #28
Georges Khalil
On 2014/12/03 20:05:17, Peter Kasting wrote: > On 2014/12/03 19:46:43, Georges Khalil wrote: > > ...
6 years ago (2014-12-03 20:31:43 UTC) #29
Georges Khalil
PTAL. - Restored StringPrintf, as per Nico's comments.
6 years ago (2014-12-03 20:32:19 UTC) #30
Nico
https://codereview.chromium.org/747013003/diff/200001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (left): https://codereview.chromium.org/747013003/diff/200001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#oldcode89 chrome/browser/extensions/api/font_settings/font_settings_api.cc:89: std::string pref_name = base::StringPrintf("%s.%s", map_name, script); doesn't look restored?
6 years ago (2014-12-03 20:34:34 UTC) #31
Georges Khalil
PTAL. - My bad, there is 2 of them and I only restored one. Brain ...
6 years ago (2014-12-03 20:40:55 UTC) #32
Nico
lgtm with "- Replaced StringPrintf with multiple appends for improved performance." removed from the cl ...
6 years ago (2014-12-03 20:44:31 UTC) #33
Georges Khalil
On 2014/12/03 20:44:31, Nico wrote: > lgtm with "- Replaced StringPrintf with multiple appends for ...
6 years ago (2014-12-03 21:10:21 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/747013003/240001
6 years ago (2014-12-03 21:11:57 UTC) #36
Nico
sorry… https://codereview.chromium.org/747013003/diff/240001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/240001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode87 chrome/browser/extensions/api/font_settings/font_settings_api.cc:87: std::string pref_name; Now that I look at it ...
6 years ago (2014-12-03 21:16:46 UTC) #37
Peter Kasting
https://codereview.chromium.org/747013003/diff/240001/chrome/browser/extensions/api/font_settings/font_settings_api.cc File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): https://codereview.chromium.org/747013003/diff/240001/chrome/browser/extensions/api/font_settings/font_settings_api.cc#newcode90 chrome/browser/extensions/api/font_settings/font_settings_api.cc:90: std::string pref_name = base::StringPrintf("%s.%s", map_name, script); You're shadowing the ...
6 years ago (2014-12-03 21:21:03 UTC) #39
Georges Khalil
On 2014/12/03 21:16:46, Nico wrote: > sorry… > > https://codereview.chromium.org/747013003/diff/240001/chrome/browser/extensions/api/font_settings/font_settings_api.cc > File chrome/browser/extensions/api/font_settings/font_settings_api.cc (right): > ...
6 years ago (2014-12-03 21:21:38 UTC) #40
Georges Khalil
PTAL before committing as the changes are not trivial. - Eliminated |pref_name| in two places. ...
6 years ago (2014-12-03 21:58:32 UTC) #43
Nico
still lgtm
6 years ago (2014-12-03 22:02:35 UTC) #44
Peter Kasting
LGTM! https://codereview.chromium.org/747013003/diff/300001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/747013003/diff/300001/chrome/browser/themes/theme_service.cc#newcode239 chrome/browser/themes/theme_service.cc:239: if (!BrowserThemePack::IsPersistentImageID(id)) Optional: While you're here, a shorter ...
6 years ago (2014-12-03 22:08:39 UTC) #45
Georges Khalil
On 2014/12/03 22:08:39, Peter Kasting wrote: > LGTM! > > https://codereview.chromium.org/747013003/diff/300001/chrome/browser/themes/theme_service.cc > File chrome/browser/themes/theme_service.cc (right): ...
6 years ago (2014-12-03 22:34:11 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/747013003/360001
6 years ago (2014-12-03 22:35:04 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/99630) linux_chromium_gn_dbg on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_dbg/builds/22799) linux_chromium_gn_rel ...
6 years ago (2014-12-03 22:46:08 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/747013003/380001
6 years ago (2014-12-04 00:52:44 UTC) #54
commit-bot: I haz the power
Committed patchset #9 (id:380001)
6 years ago (2014-12-04 01:55:22 UTC) #55
commit-bot: I haz the power
6 years ago (2014-12-04 01:56:04 UTC) #56
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/7d527ea37727f05e36ec15744d2ce7decac37ffb
Cr-Commit-Position: refs/heads/master@{#306743}

Powered by Google App Engine
This is Rietveld 408576698