mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibJS: Make GetById and GetByValue avoid get_identifier() in common case
We now defer looking up the various identifiers by IdentifierTableIndex until the last moment. This allows us to avoid the retrieval in common cases like when a property access is cached. Knocks a ~12% item off the profile on https://ventrella.com/Clusters/
This commit is contained in:
parent
ae0cfe4f2d
commit
509c10d14d
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/awesomekling
Commit: 509c10d14d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/534
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/nico
4 changed files with 57 additions and 22 deletions
|
@ -86,6 +86,8 @@ public:
|
|||
Vector<DeprecatedFlyString> local_variable_names;
|
||||
size_t local_index_base { 0 };
|
||||
|
||||
Optional<IdentifierTableIndex> length_identifier;
|
||||
|
||||
ByteString const& get_string(StringTableIndex index) const { return string_table->get(index); }
|
||||
DeprecatedFlyString const& get_identifier(IdentifierTableIndex index) const { return identifier_table->get(index); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue