LibJS: Don't worry about deduplicating bytecode string tables

The strings will get deduplicated when actually turned into
PrimitiveString objects at runtime anyway, and keeping the string
tables deduplicated was actually wasting a lot of time.

4.4% speed-up on Kraken/stanford-crypto-ccm.js :^)
This commit is contained in:
Andreas Kling 2023-10-04 16:12:46 +02:00
parent 111622a164
commit feef542c73
2 changed files with 0 additions and 8 deletions

View file

@ -10,10 +10,6 @@ namespace JS::Bytecode {
IdentifierTableIndex IdentifierTable::insert(DeprecatedFlyString string)
{
for (size_t i = 0; i < m_identifiers.size(); i++) {
if (m_identifiers[i] == string)
return i;
}
m_identifiers.append(move(string));
return m_identifiers.size() - 1;
}

View file

@ -10,10 +10,6 @@ namespace JS::Bytecode {
StringTableIndex StringTable::insert(DeprecatedString string)
{
for (size_t i = 0; i < m_strings.size(); i++) {
if (m_strings[i] == string)
return i;
}
m_strings.append(move(string));
return m_strings.size() - 1;
}