Remove a fast lookup table from MergeInputSection.
authorRui Ueyama <ruiu@google.com>
Sun, 22 Oct 2017 23:02:07 +0000 (23:02 +0000)
committerRui Ueyama <ruiu@google.com>
Sun, 22 Oct 2017 23:02:07 +0000 (23:02 +0000)
commitd96724db42c04af11d0ff1f8a57d36cb8284752b
tree475ac159f2f2a5660d8978e49b4f07ab4288695f
parent39ff4010261d4a989a2c18612c5b99845e1f1923
Remove a fast lookup table from MergeInputSection.

We used to have a map from section piece offsets to section pieces
as a cache for binary search. But I found that the map took quite a
large amount of memory and didn't make linking faster. So, in this
patch, I removed the map.

This patch saves 566 MiB of RAM (2.019 GiB -> 1.453 GiB) when linking
clang with debug info, and the link time is 4% faster in that test case.

Thanks for Sean Silva for pointing this out.

llvm-svn: 316305
lld/ELF/InputSection.cpp
lld/ELF/InputSection.h