Files
clang-p2996/bolt/lib/Profile/BoltAddressTranslation.cpp
Amir Ayupov 79d695f049 [BOLT][NFCI] Speedup BAT::writeMaps
For a large binary with BAT section of size 38 MB with ~170k maps,
reduces writeMaps time from 70s down to 1s.

The inefficiency was in the use of std::distance with std::map::iterator
which doesn't provide random access. Use sorted vector for lookups.

Test Plan: NFC

Reviewers: maksfb, rafaelauler, dcci, ayermolo

Reviewed By: maksfb

Pull Request: https://github.com/llvm/llvm-project/pull/112061
2024-10-11 21:40:53 -07:00

25 KiB