New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 707870 link

Starred by 8 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug


Show other hotlists

Hotlists containing this issue:
speed-binarysize-backlog


Sign in to add a comment

Optimize protocol buffers native code size

Project Member Reported by agrieve@chromium.org, Apr 3 2017

Issue description

Protocol buffers take up >900kb of libchrome.so:
  tools/binary_size/console.py out-gn/Release/lib.unstripped/libchrome.so.map.gz --query 'symbols.WhereObjectPathMatches("/protobuf/|.pb.o$")'

Ideas to reduce the overhead:
1. Add lite_runtime to these: https://cs.chromium.org/search/?q=lang:proto+-optimize_for+file:%5Esrc/+package:%5Echromium$+-f:third_party&type=cs
2. Consider trading off on runtime performance for binary size/symbol leaks by changing optimize_for to CODE_SIZE for https://cs.chromium.org/search/?q=lang:proto+optimize_for+file:%5Esrc/+package:%5Echromium$+-f:third_party&type=cs
3. Try out a change where you mark every proto field as [weak = true]. This will trade off on runtime performance for linker optimization to drop unused portions of your proto trees
4. Delete all unused fields from .proto files (so they will be skipped over at runtime)
5. Switch to https://github.com/nanopb/nanopb (reportedly 10x smaller code size)
 
Labels: Good-ROI
Labels: -Good-ROI Quick-Win
Labels: intern
Labels: -binary-size Performance-Size
Cc: zea@chromium.org
Owner: hua...@chromium.org
+zea in case you have ideas here.

Comment 6 by zea@chromium.org, May 15 2017

Cc: s...@chromium.org
Components: Services>Sync
+Sky who I think was investigating proto changes. LITE_RUNTIME, which Sync already uses, seems like it would be a good first step.

Comment 7 by hua...@chromium.org, May 16 2017

Updated params from agrieve@:

Categorize:
tools/binary_size/supersize console chrome.size --query 'Print(canned_queries.CategorizeGenerated())'

Extract Protocol Buffer related stuff:
tools/binary_size/supersize console chrome.size --query 'Print(size_info.symbols.WhereObjectPathMatches(".*/protobuf/|\\.pb\\.o$|\\.pbzero\\.o$").Sorted(),verbose=1)'

Cc: hua...@chromium.org
Owner: ----
Not working on this actively.

Comment 9 by zea@chromium.org, Jan 17 2018

Labels: SyncStarter2018 SyncHandoff2018

Comment 10 by zea@chromium.org, Jan 17 2018

Labels: -SyncStarter2018 Hotlist-GoodFirstBug
Description: Show this description
Description: Show this description

Sign in to add a comment