Issue metadata
Sign in to add a comment
|
Make chrome/android built with clang by default, arm32 |
||||||||||||||||||||||||
Issue descriptionthakis@thakis:~/src/chrome/src$ ls -hl out/gnand5/gen/chrome/android/chrome_public_apk__prepare_native/packed-libs/libchrome.so -rwxr-x--- 1 thakis eng 41M Oct 10 16:58 out/gnand5/gen/chrome/android/chrome_public_apk__prepare_native/packed-libs/libchrome.so is_clang = true thakis@thakis:~/src/chrome/src$ ls -hl out/gnand6/gen/chrome/android/chrome_public_apk__prepare_native/packed-libs/libchrome.so -rwxr-x--- 1 thakis eng 44M Oct 10 17:08 out/gnand6/gen/chrome/android/chrome_public_apk__prepare_native/packed-libs/libchrome.so (first is gcc, second is clang) Some size difference remains -- bug 563748 already tracks size.
,
Jun 14 2017
Interesting numbers! pcc might find them interesting. I'll dupe this into the parent since we ended up switching globally instead of per-arch.
,
Jun 15 2017
Another interesting tidbit is that the switch increases our update patch size by 20mb: https://chromeperf.appspot.com/report?sid=0fcfa4d16fe0d04158a52a82000224676acfdadb010095337cd330f0c716ae90&num_points=4000 Obviously unavoidable, but +nyquist, +amineer as fyi
,
Jun 15 2017
Just to be clear, that bump in patch size is a one-off across all our channels, right? I mean, for the next release after the big patch size, it'd go down to normal levels? The charts aren't clear on that, as I assume they always goes towards the latest released one?
,
Jun 15 2017
Out of interest: for a stable update I would expect this to be not super uncommon since quite a bit of code changes between stables. Is that correct? What's the usual diff size for stable updates? (For minor updates on stable, or between dev updates, I'd expect diff sizes to be much smaller normally.) We update clang much more frequently than we used to update the ndk and its compiler. I wouldn't be surprised if diff size after compiler updates are fairly large too. We used the "full stable update diffs will be large-ish anyway" theory to justify that.
,
Jun 15 2017
Re 4: In general yes, modulo the more frequent compiler updates, which I'd expect might sometimes cause larger one-time diffs too.
,
Jun 15 2017
Attaching .size files that I looked in case anyone else (including future self) wants to do some comparisons.
,
Jun 15 2017
,
Jun 15 2017
The diff varies a bit dependent on lots of different things. For arm earlier this year, I think the bsdiff updates were typically around ~15 MB (ballpark number). Except for builds that target before Android L (in Chrome's case, that's Android J and Android K), for which it's around ~30MB (again, ballpark).
,
Jun 15 2017
Yeah, if this is +20MB for each upgrade (and so we move from 15MB -> 35MB as an average) I don't know that's going to be acceptable. nyquist@, is there any way we could estimate what that would do to our up to date rate?
,
Jun 15 2017
I don't think there's a way to predict how the compiler is going to change in the future. I also don't think that future diffs will be this large. Let's monitor how this develops, and if it does stay that high, then let's come up with something then (a limit on how often to rev the compiler, or something).
,
Jun 15 2017
(Also, I should point out that the compiler revision is pinned in src.git, so on a branch the compiler never changes and minor stable release diff sizes will be 100% unaffected.)
,
Jun 15 2017
> I don't think there's a way to predict how the compiler is going to change in the future. I also don't think that future diffs will be this large. Can we s/think/know here by performing some analysis or is that impossible?
,
Jun 15 2017
You could try building several previous milestones with clang (I'd guess that most of them should compile fine, but we don't have offical clang bots afaik, so who knows) and compute patch diff sizes between those binaries I suppose.
,
Jun 16 2017
Note: A recent change removed 275kb from SkColorSpaceXform. https://skia-review.googlesource.com/c/19744/
,
Jun 23 2017
Not sure if this is useful at all:
Top 50 .rodata diffs by path:
>>> Print(Diff().symbols.WhereInSection('r').GroupedByPath().Sorted())
141 symbols added (+), 2332 changed (~), 1439 removed (-), 421 unchanged (not shown)
Number of unique symbols 21210 -> 15686 (-5524)
140 paths added, 1414 removed, 2158 changed
Showing 4,333 symbols (aliases not grouped for diffs) with total pss: -54856 bytes
.text=0 bytes .rodata=-53.6kb .data*=0 bytes .bss=0 bytes total=-53.6kb
Number of unique paths: 4236
Index | Running Total | Section@Address | Δ PSS (Δ size_without_padding) | Path
------------------------------------------------------------
~ 0) 85254 (-155.4%) r@Group +85254 (2884481->2966990) {no path} (count=3)
~ 1) 81406 (-148.4%) r@Group -3848 (118912->115064) third_party/webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.cc (count=1254)
~ 2) 84421 (-153.9%) r@Group +3015 (104->3119) content/browser/appcache/appcache_database.cc (count=42)
~ 3) 81739 (-149.0%) r@Group -2682 (26504->23822) content/common/content_message_generator.cc (count=742)
~ 4) 79241 (-144.5%) r@Group -2498 (20363->17887) {shared} (count=59)
+ 5) 81551 (-148.7%) r@Group +2310 (0->2310) components/history/core/browser/thumbnail_database.cc (count=24)
~ 6) 83805 (-152.8%) r@Group +2254 (328->2582) components/offline_pages/core/offline_page_metadata_store_sql.cc (count=24)
~ 7) 81627 (-148.8%) r@Group -2178 (2216->38) third_party/zlib/inflate.c (count=4)
+ 8) 83803 (-152.8%) r@Group +2176 (0->2176) third_party/zlib/{shared} (count=2)
~ 9) 81643 (-148.8%) r@Group -2160 (38392->36232) chrome/browser/flag_descriptions.cc (count=620)
- 10) 79627 (-145.2%) r@Group -2016 (2016->0) third_party/webrtc/pc/peerconnectionfactory.cc (count=59)
~ 11) 81482 (-148.5%) r@Group +1855 (1856->3708) third_party/WebKit/Source/core/frame/UseCounter.cpp (count=2)
~ 12) 79716 (-145.3%) r@Group -1766 (5448->3682) v8/src/interpreter/bytecodes.cc (count=314)
~ 13) 81327 (-148.3%) r@Group +1611 (168->1764) ui/events/keycodes/keyboard_code_conversion_android.cc (count=3)
~ 14) 82812 (-151.0%) r@Group +1485 (288->1773) components/offline_pages/core/background/request_queue_store_sql.cc (count=22)
~ 15) 84208 (-153.5%) r@Group +1396 (144->1540) components/history/core/browser/download_database.cc (count=5)
- 16) 82864 (-151.1%) r@Group -1344 (1344->0) gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc (count=1)
~ 17) 81570 (-148.7%) r@Group -1294 (22960->21666) third_party/{shared} (count=20)
~ 18) 82845 (-151.0%) r@Group +1275 (500->1612) third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp (count=76)
~ 19) 81589 (-148.7%) r@Group -1256 (1316->57) third_party/webrtc/pc/peerconnection.cc (count=57)
~ 20) 80397 (-146.6%) r@Group -1192 (2552->1360) gpu/command_buffer/service/gles2_cmd_validation.cc (count=54)
~ 21) 79266 (-144.5%) r@Group -1131 (1152->21) content/browser/service_worker/service_worker_storage.cc (count=43)
~ 22) 78218 (-142.6%) r@Group -1048 (2144->1096) third_party/libvpx/source/libvpx/vp8/encoder/vp8_quantize.c (count=6)
~ 23) 77194 (-140.7%) r@Group -1024 (9216->8192) third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c (count=9)
~ 24) 76182 (-138.9%) r@Group -1012 (1032->20) third_party/webrtc/pc/channel.cc (count=43)
~ 25) 75189 (-137.1%) r@Group -993 (17824->16811) third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc (count=12)
~ 26) 74275 (-135.4%) r@Group -914 (8640->7726) chrome/common/pref_names.cc (count=250)
~ 27) 75175 (-137.0%) r@Group +900 (600->1500) v8/src/wasm/wasm-opcodes.cc (count=54)
~ 28) 76061 (-138.7%) r@Group +886 (184->1070) components/previews/core/previews_opt_out_store_sql.cc (count=19)
~ 29) 75265 (-137.2%) r@Group -796 (6304->5508) content/public/common/content_switches.cc (count=229)
~ 30) 74566 (-135.9%) r@Group -699 (720->20) components/history/core/browser/history_service.cc (count=34)
- 31) 73870 (-134.7%) r@Group -696 (696->0) components/autofill/core/browser/webdata/autofill_webdata_service.cc (count=27)
~ 32) 73177 (-133.4%) r@Group -693 (752->59) content/browser/renderer_host/render_process_host_impl.cc (count=39)
~ 33) 72537 (-132.2%) r@Group -640 (656->16) third_party/webrtc/pc/{shared} (count=39)
+ 34) 73176 (-133.4%) r@Group +639 (0->639) components/history/core/browser/top_sites_database.cc (count=5)
- 35) 72568 (-132.3%) r@Group -608 (608->0) chrome/browser/android/vr_shell/vr_gl_thread.cc (count=29)
~ 36) 71975 (-131.2%) r@Group -593 (616->23) content/browser/background_sync/background_sync_manager.cc (count=23)
- 37) 71391 (-130.1%) r@Group -584 (584->0) content/browser/service_worker/service_worker_context_wrapper.cc (count=22)
~ 38) 71968 (-131.2%) r@Group +577 (128->668) content/renderer/accessibility/blink_ax_enum_conversion.cc (count=13)
- 39) 71432 (-130.2%) r@Group -536 (536->0) third_party/webrtc/p2p/base/transportcontroller.cc (count=22)
~ 40) 70901 (-129.2%) r@Group -531 (760->229) content/browser/service_worker/service_worker_database.cc (count=32)
~ 41) 70376 (-128.3%) r@Group -525 (261992->261467) net/http/transport_security_state.cc (count=81)
- 42) 69856 (-127.3%) r@Group -520 (520->0) components/sync/driver/glue/sync_backend_host_impl.cc (count=20)
- 43) 69344 (-126.4%) r@Group -512 (512->0) media/base/pipeline_impl.cc (count=29)
~ 44) 69852 (-127.3%) r@Group +508 (96->472) chrome/browser/android/vr_shell/ui_scene_manager.cc (count=40)
~ 45) 69354 (-126.4%) r@Group -498 (1292->794) gpu/config/gpu_driver_bug_list_autogen.cc (count=142)
- 46) 68859 (-125.5%) r@Group -495 (492->0) v8/src/{shared} (count=19)
~ 47) 69340 (-126.4%) r@Group +481 (28280->28761) gpu/command_buffer/service/gles2_cmd_apply_framebuffer_attachment_cmaa_intel.cc (count=5)
~ 48) 68864 (-125.5%) r@Group -476 (5760->5284) components/policy/policy_constants.cc (count=161)
~ 49) 68389 (-124.7%) r@Group -475 (11926->11460) third_party/sqlite/amalgamation/sqlite3.c (count=126)
~ 50) 67916 (-123.8%) r@Group -473 (488->15) content/browser/service_worker/service_worker_context_core.cc (count=17)
Top 50 .data symbols:
102 symbols added (+), 4654 changed (~), 50 removed (-), 4481 unchanged (not shown)
Number of unique symbols 27882 -> 27767 (-115)
102 paths added, 42 removed, 4480 changed
Showing 9,287 symbols (aliases not grouped for diffs) with total pss: -43672 bytes
.text=0 bytes .rodata=0 bytes .data*=-42.6kb .bss=0 bytes total=-42.6kb
Number of unique paths: 9126
Index | Running Total | Section@Address | Δ PSS (Δ size_without_padding) | Path
------------------------------------------------------------
~ 0) -14896 (34.1%) d@Group -14896 (17844->2948) chrome/browser/about_flags.cc (count=98)
+ 1) -10244 (23.5%) d@Group +4652 (0->4648) v8/src/interpreter/bytecode-decoder.cc (count=1)
~ 2) -13228 (30.3%) d@Group -2984 (23680->20696) content/common/content_message_generator.cc (count=746)
+ 3) -10608 (24.3%) d@Group +2620 (0->2620) v8/src/builtins/builtins.cc (count=1)
~ 4) -8184 (18.7%) d@Group +2424 (2772->5196) ui/events/keycodes/dom/keycode_converter.cc (count=2)
~ 5) -6416 (14.7%) d@Group +1768 (40->1788) net/log/net_log.cc (count=5)
- 6) -8016 (18.4%) d@Group -1600 (1600->0) ui/gl/gl_stub_autogen_gl.cc (count=1)
~ 7) -6424 (14.7%) d@Group +1592 (4->1592) v8/src/compiler/instruction.cc (count=4)
+ 8) -4986 (11.4%) d@Group +1438 (0->0) {no path} (count=3)
~ 9) -6398 (14.7%) d@Group -1412 (15264->13852) v8/src/compiler/machine-operator.cc (count=478)
~ 10) -5182 (11.9%) d@Group +1216 (288->1504) v8/src/messages.cc (count=4)
~ 11) -4022 (9.2%) d@Group +1160 (72->1220) v8/src/wasm/function-body-decoder.cc (count=7)
~ 12) -5126 (11.7%) d@Group -1104 (1712->608) blink/core/HTMLElementFactory.cpp (count=2)
~ 13) -6158 (14.1%) d@Group -1032 (2104->1072) components/search_engines/template_url_prepopulate_data.cc (count=109)
~ 14) -7066 (16.2%) d@Group -908 (7464->6536) {shared} (count=272)
~ 15) -7914 (18.1%) d@Group -848 (3616->2768) third_party/sfntly/src/cpp/src/sfntly/table/truetype/glyph_table.cc (count=50)
~ 16) -8726 (20.0%) d@Group -812 (1544->732) third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp (count=14)
~ 17) -7998 (18.3%) d@Group +728 (472->1200) content/browser/renderer_host/compositor_impl_android.cc (count=4)
~ 18) -8722 (20.0%) d@Group -724 (1176->452) third_party/WebKit/Source/core/workers/WorkletGlobalScope.cpp (count=8)
- 19) -9426 (21.6%) d@Group -704 (704->0) third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp (count=6)
+ 20) -8798 (20.1%) d@Group +628 (0->620) third_party/angle/src/compiler/translator/Operator.cpp (count=1)
~ 21) -9418 (21.6%) d@Group -620 (1564->944) third_party/WebKit/Source/web/WebLocalFrameImpl.cpp (count=8)
+ 22) -8810 (20.2%) d@Group +608 (0->608) third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp (count=1)
~ 23) -9414 (21.6%) d@Group -604 (612->12) third_party/WebKit/Source/core/dom/ExecutionContext.cpp (count=10)
+ 24) -8866 (20.3%) d@Group +548 (0->508) components/sync/protocol/proto_enum_conversions.cc (count=19)
- 25) -9378 (21.5%) d@Group -512 (512->0) blink/core/SVGElementFactory.cpp (count=1)
- 26) -9882 (22.6%) d@Group -504 (504->0) third_party/sfntly/src/cpp/src/sfntly/table/{shared} (count=8)
~ 27) -10386 (23.8%) d@Group -504 (1096->580) third_party/skia/src/jumper/SkJumper.cpp (count=7)
- 28) -10882 (24.9%) d@Group -496 (496->0) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table.cc (count=8)
~ 29) -10394 (23.8%) d@Group +488 (344->828) third_party/webrtc/api/statstypes.cc (count=11)
+ 30) -9918 (22.7%) d@Group +476 (0->464) net/quic/core/quic_error_codes.cc (count=2)
- 31) -10374 (23.8%) d@Group -456 (456->0) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/bitmap_glyph.cc (count=8)
- 32) -10830 (24.8%) d@Group -456 (456->0) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/glyph_metrics.cc (count=8)
~ 33) -11286 (25.8%) d@Group -456 (1560->1104) third_party/sfntly/src/cpp/src/sfntly/table/truetype/loca_table.cc (count=23)
~ 34) -10838 (24.8%) d@Group +448 (948->1396) third_party/WebKit/Source/core/svg/{shared} (count=24)
~ 35) -10402 (23.8%) d@Group +436 (20->456) third_party/libxml/src/parser.c (count=3)
~ 36) -10822 (24.8%) d@Group -420 (1696->1276) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table_format1.cc (count=24)
~ 37) -11242 (25.7%) d@Group -420 (1696->1276) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table_format2.cc (count=24)
~ 38) -11662 (26.7%) d@Group -420 (1696->1276) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table_format3.cc (count=24)
~ 39) -12082 (27.7%) d@Group -420 (1696->1276) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table_format4.cc (count=24)
~ 40) -12502 (28.6%) d@Group -420 (1696->1276) third_party/sfntly/src/cpp/src/sfntly/table/bitmap/index_sub_table_format5.cc (count=24)
~ 41) -12914 (29.6%) d@Group -412 (10936->10504) v8/src/crankshaft/arm/lithium-arm.cc (count=127)
- 42) -13314 (30.5%) d@Group -400 (400->0) third_party/WebKit/Source/core/html/forms/BaseTemporalInputType.cpp (count=1)
~ 43) -13710 (31.4%) d@Group -396 (7040->6636) v8/src/compiler/simplified-operator.cc (count=223)
~ 44) -13314 (30.5%) d@Group +396 (624->1008) v8/src/interface-descriptors.cc (count=27)
~ 45) -12918 (29.6%) d@Group +396 (312->692) v8/src/objects.cc (count=17)
~ 46) -12530 (28.7%) d@Group +388 (40->416) third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp (count=3)
+ 47) -12162 (27.8%) d@Group +368 (0->352) v8/src/heap/gc-tracer.cc (count=3)
+ 48) -11802 (27.0%) d@Group +360 (0->356) third_party/angle/src/compiler/translator/Types.cpp (count=9)
~ 49) -12146 (27.8%) d@Group -344 (3440->3096) gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc (count=87)
~ 50) -12486 (28.6%) d@Group -340 (1968->1616) third_party/sfntly/src/cpp/src/sfntly/table/core/name_table.cc (count=33)
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by agrieve@chromium.org
, Jun 13 2017Some stats on clang vs gcc by running supersize on a local build with GCC vs Clang: Per-Section Summary: Section Sizes (Total=-280kb (-287355 bytes)): .bss: 10.2kb (10496 bytes) (not included in totals) .data: -52.6kb (-53912 bytes) (18.8%) .data.rel.ro: 816kb (835584 bytes) (-290.8%) .data.rel.ro.local: -806kb (-825344 bytes) (287.2%) .rel.dyn: 14.6kb (14944 bytes) (-5.2%) .rodata: -53.6kb (-54856 bytes) (19.1%) .text: -205kb (-210236 bytes) (73.2%) .init_array: -180 bytes (-180 bytes) * Interesting that there is 50kb smaller .rodata and .data. * Looks like ".data.rel.ro.local" is renamed to ".data.rel.ro" * .init_array is smaller. Likely there are now fewer files with static initializers (yay!). * This makes sense since our bots were only blocking SI additions on platforms that use clang. * Print(diff.symbols.WhereNameMatches(r'^_GLOBAL__')) shows there are 54 fewer static initializers. 132596 symbols added (+), 271039 changed (~), 29028 removed (-), 81536 unchanged (not shown) Number of unique symbols 324513 -> 376006 (+51493) 1 paths added, 14 removed, 15044 changed * ~100k new symbols, of which ~51k are not just aliases. That's quite a bit! * Probably this is a result of less inlining. Let's look at coverage: GCC has: Section r: has 100.0% of 6242382 bytes accounted for from 21210 symbols. 0 bytes are unaccounted for. * Padding accounts for 1724 bytes (0.0%) * 10 placeholders (symbols that start with **) account for 2884482 bytes (46.2%) * 916 symbols have shared ownership (264762 bytes) Section b: has 100.0% of 1940827 bytes accounted for from 19969 symbols. 77 bytes are unaccounted for. * Padding accounts for 1061 bytes (0.1%) * 0 symbols have shared ownership Section d: has 100.0% of 1998112 bytes accounted for from 27882 symbols. 0 bytes are unaccounted for. * Padding accounts for 2139 bytes (0.1%) * 1272 symbols have shared ownership (55872 bytes) Section t: has 100.0% of 37699764 bytes accounted for from 334044 symbols. 0 bytes are unaccounted for. * Padding accounts for 46271 bytes (0.1%) * 10 placeholders (symbols that start with **) account for 357269 bytes (0.9%) * Contains 88157 aliases, mapped to 9565 unique addresses (568598 bytes) * 18185 symbols have shared ownership (1008722 bytes) Clang has: Section r: has 100.0% of 6187526 bytes accounted for from 15685 symbols. 0 bytes are unaccounted for. * Padding accounts for 6677 bytes (0.1%) * 23 placeholders (symbols that start with **) account for 2967019 bytes (48.0%) * 500 symbols have shared ownership (259420 bytes) Section b: has 100.0% of 1951307 bytes accounted for from 12627 symbols. 93 bytes are unaccounted for. * Padding accounts for 4634 bytes (0.2%) * 0 symbols have shared ownership Section d: has 100.0% of 1954440 bytes accounted for from 27764 symbols. 0 bytes are unaccounted for. * Padding accounts for 4945 bytes (0.3%) * 1076 symbols have shared ownership (44975 bytes) Section t: has 100.0% of 37489528 bytes accounted for from 442143 symbols. 0 bytes are unaccounted for. * Padding accounts for 70165 bytes (0.2%) * 9 placeholders (symbols that start with **) account for 542105 bytes (1.4%) * Contains 136107 aliases, mapped to 13889 unique addresses (589382 bytes) * 38218 symbols have shared ownership (1375282 bytes) * clang has fewer .rodata symbols, yet more bytes lost to alignment * clang has more bytes attribute to "** merge strings" * clang has ~50% fewer .rodata symbols that show up in the nm output of .o files. * clang has even more space attributed to symbol gaps in .text ( bug 709050 ) Let's look at .o files that are added/removed: Added files: third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a/cxa_aux_runtime.o Removed files: cc/ipc/compositor_frame_metadata.mojom.cc cc/ipc/filter_operations.mojom.cc components/tracing/proto/event.pbzero.cc components/tracing/proto/events_chunk.pbzero.cc services/ui/public/interfaces/window_tree.mojom.cc third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a/_ctzdi2.o third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a/_popcountdi2.o third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a/_popcountsi2.o third_party/protobuf/src/google/protobuf/stubs/structurally_valid.cc third_party/skia/src/core/SkDeviceProfile.cpp third_party/skia/src/core/SkExecutor.cpp third_party/skia/src/core/SkLiteDL.cpp ui/base/cursor/cursor_data.cc v8/src/trap-handler/handler-shared.cc * I don't think the linker does any inlining across .o files, so I think the removed files would be due to symbols in those files now being unreferenced (as opposed to them just being entirely inlined). * Digging into a few of these paths: >>> Print(diff.symbols.WherePathMatches(r'cxa_aux_runtime')) + 0) 40 (100.0%) t@0x266a078 40 third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++abi.a/cxa_aux_runtime.o __cxa_bad_typeid >>> Print(diff.symbols.WherePathMatches(r'compositor_frame_metadata.mojom.cc')) - 0) -8 (100.0%) r@0x0 -8 cc/ipc/compositor_frame_metadata.mojom.cc CSWTCH.95 >>> Print(diff.symbols.WherePathMatches(r'components/tracing/proto/event.pbzero.cc')) - 0) -160 (100.0%) t@0x0 -160 components/tracing/proto/event.pbzero.cc _GLOBAL__sub_I_event.pbzero.cc - 1) -160 (100.0%) b@0x0 -96 components/tracing/proto/event.pbzero.cc pbzero::tracing::proto::kFields_Event - 2) -160 (100.0%) b@0x0 -16 components/tracing/proto/event.pbzero.cc kInvalidField * The 2nd one leads me to believe that gcc/gold was not properly removing unused generated symbols for switch statements. * The 3rd one corroborates .init_array being smaller. The _GLOBAL is a static-initializer, which likely causes the other symbols to be kept. Let's look at the largest changed symbols: Index, Running Total, Section@Address, PSS ------------------------------------------------------------ ~ 0) 184836 (-59.9%) t@Group 184836 {no path} ** symbol gaps (count=10) ~ 1) 301239 (-97.6%) t@0x485a60 107256 third_party/skia/src/core/SkColorSpaceXform.cpp SkColorSpaceXform_XYZ::onApply const ~ 2) 386131 (-125.1%) t@0x4a09f0 84892 third_party/skia/src/core/SkColorSpaceXform.cpp SkColorSpaceXform_XYZ::onApply const ~ 3) 470339 (-152.3%) t@0x4b6070 84208 third_party/skia/src/core/SkColorSpaceXform.cpp SkColorSpaceXform_XYZ::onApply const ~ 4) 546998 (-177.2%) r@Group 76659 {no path} ** merge strings (count=7) + 5) 576586 (-186.7%) t@0x2e6980 29588 chrome/browser/about_flags.cc startup ~ 6) 598850 (-194.0%) t@0x535f20 22264 third_party/skia/src/core/SkScan_AAAPath.cpp SkScan::AAAFillPath + 7) 619330 (-200.6%) t@0x156caf8 20480 third_party/libjpeg_turbo/jchuff.c encode_one_block ~ 8) 639454 (-207.1%) t@0x1035800 20124 v8/src/compiler/typer.cc v8::internal::compiler::Typer::Visitor::Reduce ~ 9) 658122 (-213.1%) t@0x5b1c34 18668 third_party/skia/src/effects/SkLightingImageFilter.cpp SkDiffuseLightingImageFilter::onFilterImage const ... * Most of these are probably the result of different inlining decisions. * As above, would love to know what these gaps are all about ( bug 709050 ) * Might be more useful to look on a per-file basis to avoid inlining differences. >>> Print(diff.symbols.GroupedByPath().Sorted()) Index, Running Total, Section@Address, PSS ------------------------------------------------------------ ~ 0) 279926 (-90.7%) *@Group 279926 {no path} (count=9) ~ 1) 394433 (-127.7%) *@Group 114507 third_party/skia/src/core/SkColorSpaceXform.cpp (count=148) ~ 2) 439141 (-142.2%) *@Group 44708 v8/src/crankshaft/hydrogen.cc (count=574) ~ 3) 403683 (-130.7%) *@Group -35458 third_party/libyuv/source/row_common.cc (count=48) ~ 4) 370555 (-120.0%) *@Group -33128 v8/src/parsing/parameter-initializer-rewriter.cc (count=40) ~ 5) 341288 (-110.5%) *@Group -29267 content/common/content_message_generator.cc (count=5227) ~ 6) 370180 (-119.9%) *@Group 28891 third_party/skia/src/effects/SkLightingImageFilter.cpp (count=159) ~ 7) 397393 (-128.7%) *@Group 27213 third_party/skia/src/core/SkLinearBitmapPipeline.cpp (count=382) ~ 8) 424492 (-137.5%) *@Group 27099 third_party/harfbuzz-ng/src/hb-ot-layout.cc (count=668) ~ 9) 451418 (-146.2%) *@Group 26925 v8/src/bootstrapper.cc (count=105) ~ 10) 478006 (-154.8%) *@Group 26588 third_party/sqlite/amalgamation/sqlite3.c (count=1802) ~ 11) 504557 (-163.4%) *@Group 26551 third_party/libwebp/dsp/{shared} (count=58) ~ 12) 531025 (-172.0%) *@Group 26468 v8/src/inspector/protocol/Runtime.cpp (count=174) ~ 13) 554935 (-179.7%) *@Group 23909 v8/src/objects.cc (count=902) ~ 14) 577375 (-187.0%) *@Group 22439 v8/src/runtime/runtime-debug.cc (count=211) ~ 15) 598515 (-193.8%) *@Group 21140 base/third_party/dmg_fp/dtoa_wrapper.cc (count=32) ~ 16) 618603 (-200.3%) *@Group 20087 v8/src/compiler/typer.cc (count=102) ~ 17) 637277 (-206.4%) *@Group 18673 third_party/libwebp/dsp/yuv.c (count=30) ~ 18) 618839 (-200.4%) *@Group -18438 v8/src/compiler/simplified-lowering.cc (count=91) ~ 19) 600768 (-194.6%) *@Group -18070 v8/src/ast/ast-numbering.cc (count=53) ~ 20) 618052 (-200.2%) *@Group 17284 v8/src/runtime/runtime-atomics.cc (count=30) ~ 21) 635285 (-205.8%) *@Group 17232 v8/src/inspector/protocol/Debugger.cpp (count=119) ~ 22) 650979 (-210.8%) *@Group 15693 v8/src/parsing/parser.cc (count=232) ~ 23) 635647 (-205.9%) *@Group -15332 third_party/libyuv/source/scale_common.cc (count=20) ~ 24) 650071 (-210.5%) *@Group 14424 v8/src/deoptimizer.cc (count=133) ~ 25) 664261 (-215.1%) *@Group 14190 chrome/browser/about_flags.cc (count=119) ~ 26) 650391 (-210.6%) *@Group -13869 v8/src/compiler/ast-loop-assignment-analyzer.cc (count=50) ~ 27) 663387 (-214.9%) *@Group 12995 gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc (count=362) ~ 28) 650643 (-210.7%) *@Group -12743 gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc (count=487) ~ 29) 663065 (-214.7%) *@Group 12421 {shared} (count=12215) ~ 30) 675254 (-218.7%) *@Group 12189 v8/src/wasm/wasm-objects.cc (count=100) ~ 30) 675254 (-218.7%) *@Group 12189 v8/src/wasm/wasm-objects.cc (count=100) ~ 31) 663916 (-215.0%) *@Group -11338 ui/gl/gl_bindings_autogen_gl.cc (count=1586) ~ 32) 652648 (-211.4%) *@Group -11268 v8/src/interpreter/bytecode-decoder.cc (count=7) ~ 33) 663874 (-215.0%) *@Group 11226 v8/src/runtime/runtime-regexp.cc (count=114) ~ 34) 675078 (-218.6%) *@Group 11203 content/{shared} (count=1161) * Index 0 is the symbol gaps thing again. * SkColorSpaceXform has come up a couple times for its size (bug 660416, bug 677450 ). It seems clang makes it even bigger. * The diff here can't be 100% trusted, since there may be different sharing of symbols going on. * When a symbol is listed in the nm output of multiple .o files, its path is set to common_anscestor/{shared} * Still, the sharing information should be somewhat consistent between GCC & clang, so I think there a good chance that GCC produces smaller code for most of these that are marked as increases. * clang is only smaller because it has a long tail of files that shrink by < 1kb Other interesting queries: >>> Print(canned_queries.CategorizeGenerated(diff.symbols)) Showing 8 symbols (8 unique) with total pss: 385423 bytes .text=378kb .rodata=-580 bytes .data*=-1386 bytes .bss=-672 bytes total=376kb Number of unique paths: 1551 Index, Running Total, Section@Address, PSS ------------------------------------------------------------ 0) 228623 (59.3%) *@Group 228623 Mojo (count=9077) 1) 313657 (81.4%) *@Group 85033 Protocol Buffers (count=4780) 2) 357055 (92.6%) *@Group 43398 Blink (bindings) (count=3854) 3) 375423 (97.4%) *@Group 18368 DevTools (count=739) 4) 387100 (100.4%) *@Group 11677 Blink (IDL) (count=637) 5) 387032 (100.4%) *@Group -68 RegisterJNI (count=4) 6) 383422 (99.5%) *@Group -3610 Blink (Other) (count=388) 7) 385423 (100.0%) *@Group 2000 Other (count=260) >>> Print(canned_queries.CategorizeByChromeComponent(diff.symbols)) Showing 25 symbols (25 unique) with total pss: -308764 bytes .text=-205kb .rodata=-53.6kb .data*=-42.6kb .bss=10.2kb total=-301kb Number of unique paths: 15552 Index, Running Total, Section@Address, PSS ------------------------------------------------------------ 0) 292884 (-94.9%) *@Group 292884 V8 (count=29304) 1) 443110 (-143.5%) *@Group 150226 Skia (count=12430) 2) 541304 (-175.3%) *@Group 98193 Blink (generated) (count=6244) 3) 623348 (-201.9%) *@Group 82044 Codecs (count=6016) 4) 646459 (-209.4%) *@Group 23110 ICU (count=7878) 5) 658155 (-213.2%) *@Group 11696 libxml (count=1109) 6) 664589 (-215.2%) *@Group 6433 WebBluetooth (count=3854) 7) 667454 (-216.2%) *@Group 2865 XSLT (count=450) 8) 668265 (-216.4%) *@Group 810 WebUSB (count=2564) 9) 667477 (-216.2%) *@Group -787 Cast (count=258) 10) 666124 (-215.7%) *@Group -1353 FileSystem (count=1555) 11) 663799 (-215.0%) *@Group -2324 WebCrypto (count=665) 12) 660965 (-214.1%) *@Group -2834 Printing (count=1032) 13) 657836 (-213.1%) *@Group -3128 Media Source (count=691) 14) 654573 (-212.0%) *@Group -3263 Internals Pages (count=1701) 15) 650557 (-210.7%) *@Group -4015 Prefetch (count=851) 16) 645658 (-209.1%) *@Group -4898 WebVR (count=3227) 17) 638185 (-206.7%) *@Group -7473 Password Manager (count=2489) 18) 621084 (-201.2%) *@Group -17101 Autofill (count=5732) 19) 595044 (-192.7%) *@Group -26039 WebGL (count=3358) 20) 467801 (-151.5%) *@Group -127242 WebRTC (count=22354) 21) -61412 (19.9%) *@Group -529214 Blink (non-generated) (count=133969) 22) -75687 (24.5%) *@Group -14274 Other Third-Party (count=17147) 23) 204238 (-66.1%) *@Group 279926 ** Merged Symbols (count=8) 24) -308764 (100.0%) *@Group -513002 Other (count=249313) * V8, Skia, and many Codecs all increased in code size when compiling with clang. * These also happen to be targets that set optimize_max: * https://cs.chromium.org/search/?q=optimize_max+file:%5C.gn * Seems likely that -O2 on clang generates larger code than -O2 on gcc. * May be worth revisiting whether we need optimize_max for all of these. * Blink decreased the most, by a whopping 500kb. * But again, due to the shared path subtlety pointed out above, these numbers should also be taken with a grain of salt, as they are mostly based on paths.