[PATCH] D56325: Sort symbols in .bss by size.

Vic Yang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 16:22:21 PST 2019


victoryang added a comment.

In D56325#1360753 <https://reviews.llvm.org/D56325#1360753>, @ruiu wrote:

> 4KB is just one page. Honestly I think it is hard to draw a conclusion from only that data as the difference is too small. Could you give us more data points so that we are convinced that the patch actually makes a difference?


I think in a lot of case, you actually just want to see that this doesn't cause a regression. If most symbols in a bss section are used, there is really no gain to be had here, and this is probably most of the cases. Where this change helps is when you have sparsely dirtied bss section. This is more common for versatile libraries, like libc, where you usually only use a part of it. So far, I've tested:

- libc: 36KB -> 16KB (x86_64), 32KB -> 12KB (arm32)
- Chrome on Android: 364KB -> 360KB (arm32)
- tcpdump: No change (x86_64)
- strace: No change (x86_64)

I don't think that we should expect this to work wonder for any programs. What we are more likely to see is that for some programs, you see pretty good gain, while for others, you see no change or close to no change. Based on the numbers I have so far, it certainly looks that this change is beneficial on average. This was also shown when I applied this on all (non-prebuilt) binaries on a x86_64 Android build.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56325/new/

https://reviews.llvm.org/D56325





More information about the llvm-commits mailing list