Bläddra i källkod

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 :^)
Andreas Kling 1 år sedan
förälder
incheckning
feef542c73

+ 0 - 4
Userland/Libraries/LibJS/Bytecode/IdentifierTable.cpp

@@ -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;
 }

+ 0 - 4
Userland/Libraries/LibJS/Bytecode/StringTable.cpp

@@ -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;
 }