-
Notifications
You must be signed in to change notification settings - Fork 366
Description
Hi bloat busters, today I was using bloaty to track down binary size increases.
I got output like this:
FILE SIZE VM SIZE
-------------- --------------
[NEW] +1016Ki [NEW] +360Ki proto2::internal::InternalMetadataOffset::Build<>()
+56% +761Ki +62% +293Ki proto2::RepeatedPtrField<>::RepeatedPtrField()
I'm digging into the last line. It's many symbols, grouped together by skipping the template arguments.
It shows an increase in file size and VM size, but I'm not sure if it's:
- More symbols that are grouped into this line
- The size of each symbol getting larger
If we could output a third column: symbol count, then I could tell if it was an increase in number of symbols, or size of each symbol. This would speed diagnosis and I think this is a common question - I believe it would be broadly useful for many bloaty users. There is an analogy in memory profilers, where you capture both total allocation size and allocation count, and then you can compute from that average size per allocation.
Internal Google bug b/454428776 has more context on the internal problem we wanted to solve with this. In the end we worked around this by using nm like:
$ nm -C before.so | grep "::RepeatedPtrField(" | wc -l
$ nm -C after.so | grep "::RepeatedPtrField(" | wc -l