mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 05:52:53 +00:00
AK: Remove excessive hashing caused by FlyString table
Before this change, the global FlyString table looked like this: HashMap<StringView, Detail::StringBase> After this change, we have: HashTable<Detail::StringData const*, FlyStringTableHashTraits> The custom hash traits are used to extract the stored hash from StringData which avoids having to rehash the StringView repeatedly like we did before. This necessitated a handful of smaller changes to make it work.
This commit is contained in:
parent
8bfad24708
commit
a88799c032
Notes:
sideshowbarker
2024-07-17 11:30:05 +09:00
Author: https://github.com/awesomekling
Commit: a88799c032
Pull-request: https://github.com/SerenityOS/serenity/pull/23690
Reviewed-by: https://github.com/Hendiadyoin1
6 changed files with 28 additions and 28 deletions
|
@ -90,12 +90,6 @@ bool StringBase::operator==(StringBase const& other) const
|
|||
return bytes() == other.bytes();
|
||||
}
|
||||
|
||||
void StringBase::did_create_fly_string(Badge<FlyString>) const
|
||||
{
|
||||
VERIFY(!is_short_string());
|
||||
m_data->set_fly_string(true);
|
||||
}
|
||||
|
||||
ErrorOr<Bytes> StringBase::replace_with_uninitialized_buffer(size_t byte_count)
|
||||
{
|
||||
if (byte_count <= MAX_SHORT_STRING_BYTE_COUNT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue