llvm/llvm-project

[BOLT] Evaluate and speedup discoverFileObjects

開放

#90,661 建立於 2024年4月30日

 (14 則留言) (0 個反應) (0 位負責人)C++ (10,782 個分叉)batch import
BOLTgood first issuehelp wanted

倉庫指標

星標
 (26,378 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Operations with symbols such as name lookup are expensive and some binaries have millions of symbols, so it makes sense to try to reduce the symbol-related overheads.

Measure how much the following cost and refactor/eliminate:

  1. Checks for symbol name being equal to __asan_init and __llvm_coverage_mapping for every single symbol: https://github.com/llvm/llvm-project/blob/a1423ba4278775472523fed074de6dbdfd01898a/bolt/lib/Rewrite/RewriteInstance.cpp#L824-L837
  2. FileName set for every local function symbol (with O(1M) for large binaries) while we can instead use file symbol lookup with O(log N_Syms) cost and FileSyms memory cost https://github.com/llvm/llvm-project/pull/89088
  3. Merge iteration over two loops over symbols into one: https://github.com/llvm/llvm-project/blob/a1423ba4278775472523fed074de6dbdfd01898a/bolt/lib/Rewrite/RewriteInstance.cpp#L824 and https://github.com/llvm/llvm-project/blob/a1423ba4278775472523fed074de6dbdfd01898a/bolt/lib/Rewrite/RewriteInstance.cpp#L876

貢獻者指南