google / google/bloaty

Feature Request: Add a column showing symbol count per row

Open
#412 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
5.5k
Forks
378
Avg merge
23h 54m
Merged PRs (30d)
6

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:
1. More symbols that are grouped into this line
2. 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.