1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:17:44 +00:00

LibELF: Use binary search when looking up symbols :^)

For whatever reason, symbolication was doing an O(n) walk of all the
symbols, despite having sorted them beforehand.

Changing this to a binary_search() makes symbolication noticeably
faster and improves Profiler startup time.
This commit is contained in:
Andreas Kling 2021-05-15 00:51:23 +02:00
parent ef09f9c825
commit b31602367e
2 changed files with 49 additions and 56 deletions

View file

@ -216,6 +216,9 @@ private:
Optional<Image::Symbol> symbol;
};
void sort_symbols() const;
SortedSymbol* find_sorted_symbol(FlatPtr) const;
mutable Vector<SortedSymbol> m_sorted_symbols;
};