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

Issue 2186893002: Reduce size of generated extension FeatureProviders. (Closed)

Created:
4 years, 4 months ago by dcheng
Modified:
4 years, 4 months ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, esprehn
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reduce size of generated extension FeatureProviders. The generated feature provider code was generating a lot of std::string and std::vector objects from string literals and initializer lists. Unfortunately, this results in inlining a lot of STL code: on an official Linux build, extensions::APIFeatureProvider::APIFeatureProvider was over 200KB of code. After this change, it's still larger than expected, at just under 67KB, but it's much better than before. In all, this saves about 275KB of binary size in an official Linux GN build. BUG=631915 Committed: https://crrev.com/d8b8acff3d2d57e66b833a5632e3a993eb405277 Cr-Commit-Position: refs/heads/master@{#408350}

Patch Set 1 #

Total comments: 6

Patch Set 2 : . #

Total comments: 5

Patch Set 3 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -31 lines) Patch
M extensions/common/features/base_feature_provider.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M extensions/common/features/base_feature_provider.cc View 1 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/common/features/feature.h View 2 chunks +4 lines, -1 line 0 comments Download
M extensions/common/features/feature.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/common/features/json_feature_provider.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M extensions/common/features/simple_feature.h View 1 2 3 chunks +13 lines, -13 lines 0 comments Download
M extensions/common/features/simple_feature.cc View 1 2 1 chunk +19 lines, -13 lines 0 comments Download
M tools/json_schema_compiler/feature_compiler.py View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (12 generated)
dcheng
FWIW, the other substantial savings will probably come from not instantiating a std::unique_ptr<Feature> for each ...
4 years, 4 months ago (2016-07-27 09:48:50 UTC) #3
Devlin
I'd like to test this locally when I get into the office (about an hour) ...
4 years, 4 months ago (2016-07-27 15:36:49 UTC) #9
dcheng
https://codereview.chromium.org/2186893002/diff/1/extensions/common/features/simple_feature.cc File extensions/common/features/simple_feature.cc (right): https://codereview.chromium.org/2186893002/diff/1/extensions/common/features/simple_feature.cc#newcode672 extensions/common/features/simple_feature.cc:672: blacklist_.clear(); On 2016/07/27 15:36:49, Devlin wrote: > These should ...
4 years, 4 months ago (2016-07-27 16:07:48 UTC) #11
Devlin
lgtm. From relatively unscientific local testing, this seems about as efficient as it was before. ...
4 years, 4 months ago (2016-07-27 16:43:59 UTC) #13
Devlin
https://codereview.chromium.org/2186893002/diff/20001/extensions/common/features/base_feature_provider.h File extensions/common/features/base_feature_provider.h (right): https://codereview.chromium.org/2186893002/diff/20001/extensions/common/features/base_feature_provider.h#newcode42 extensions/common/features/base_feature_provider.h:42: void AddFeature(base::StringPiece name, std::unique_ptr<Feature> feature); For my own edification, ...
4 years, 4 months ago (2016-07-27 16:46:23 UTC) #14
dcheng
PTAL https://codereview.chromium.org/2186893002/diff/1/extensions/common/features/simple_feature.h File extensions/common/features/simple_feature.h (right): https://codereview.chromium.org/2186893002/diff/1/extensions/common/features/simple_feature.h#newcode114 extensions/common/features/simple_feature.h:114: void set_command_line_switch(std::string&& command_line_switch); On 2016/07/27 16:43:59, Devlin wrote: ...
4 years, 4 months ago (2016-07-27 17:02:36 UTC) #15
Devlin
s lgtm. https://codereview.chromium.org/2186893002/diff/20001/extensions/common/features/base_feature_provider.h File extensions/common/features/base_feature_provider.h (right): https://codereview.chromium.org/2186893002/diff/20001/extensions/common/features/base_feature_provider.h#newcode42 extensions/common/features/base_feature_provider.h:42: void AddFeature(base::StringPiece name, std::unique_ptr<Feature> feature); On 2016/07/27 ...
4 years, 4 months ago (2016-07-27 17:04:59 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2186893002/40001
4 years, 4 months ago (2016-07-28 06:28:30 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 4 months ago (2016-07-28 07:04:19 UTC) #20
commit-bot: I haz the power
4 years, 4 months ago (2016-07-28 07:07:34 UTC) #22
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/d8b8acff3d2d57e66b833a5632e3a993eb405277
Cr-Commit-Position: refs/heads/master@{#408350}

Powered by Google App Engine
This is Rietveld 408576698