[all-commits] [llvm/llvm-project] 79d695: [BOLT][NFCI] Speedup BAT::writeMaps

Amir Ayupov via All-commits all-commits at lists.llvm.org
Fri Oct 11 21:41:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79d695f049343c96eccbce9c06357256bc567be3
      https://github.com/llvm/llvm-project/commit/79d695f049343c96eccbce9c06357256bc567be3
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2024-10-11 (Fri, 11 Oct 2024)

  Changed paths:
    M bolt/include/bolt/Profile/BoltAddressTranslation.h
    M bolt/lib/Profile/BoltAddressTranslation.cpp

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list