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

LibELF: Cache consecutive lookups for the same symbol

This reduces the startup time of LibWeb by 10%, and eliminates 156'000
of the total 481'000 global symbol lookups during a self-test run.
This commit is contained in:
Daniel Bertalan 2023-08-17 08:00:08 +02:00 committed by Andreas Kling
parent 9a07ac0b6a
commit 1adf06c9f0
3 changed files with 31 additions and 6 deletions

View file

@ -84,6 +84,12 @@ public:
}
DynamicObject const& object() const { return m_dynamic; }
// This might return false even if the two Symbol objects resolve to the same thing.
bool definitely_equals(Symbol const& other) const
{
return &m_dynamic == &other.m_dynamic && &m_sym == &other.m_sym && m_index == other.m_index;
}
private:
DynamicObject const& m_dynamic;
const ElfW(Sym) & m_sym;