Title: [288537] trunk/Source/_javascript_Core
Revision
288537
Author
[email protected]
Date
2022-01-24 21:13:18 -0800 (Mon, 24 Jan 2022)

Log Message

Remove VM::stringCache
https://bugs.webkit.org/show_bug.cgi?id=235536

Reviewed by Sam Weinig.

We consult VM::stringCache when creating a JSString, but since
bug 142115 we never insert anything into it.

Removing this results in almost-significant improvements in the VueJS,
Vanilla-ES2015, and jQuery sub-tests of Speedometer 2 (of 0.5-2%,
0.03 <= p <= 0.05), and an almost significant 0.2% improvement in the
overall score (p = 0.06).

* runtime/JSString.cpp:
(JSC::jsStringWithCacheSlowCase):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (288536 => 288537)


--- trunk/Source/_javascript_Core/ChangeLog	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-01-25 05:13:18 UTC (rev 288537)
@@ -1,3 +1,24 @@
+2022-01-24  Cameron McCormack  <[email protected]>
+
+        Remove VM::stringCache
+        https://bugs.webkit.org/show_bug.cgi?id=235536
+
+        Reviewed by Sam Weinig.
+
+        We consult VM::stringCache when creating a JSString, but since
+        bug 142115 we never insert anything into it.
+
+        Removing this results in almost-significant improvements in the VueJS,
+        Vanilla-ES2015, and jQuery sub-tests of Speedometer 2 (of 0.5-2%,
+        0.03 <= p <= 0.05), and an almost significant 0.2% improvement in the
+        overall score (p = 0.06).
+
+        * runtime/JSString.cpp:
+        (JSC::jsStringWithCacheSlowCase):
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        * runtime/VM.h:
+
 2022-01-24  Diego Pino Garcia  <[email protected]>
 
         Unreviewed, fix non-unified build after r288458

Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (288536 => 288537)


--- trunk/Source/_javascript_Core/runtime/JSString.cpp	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/JSString.cpp	2022-01-25 05:13:18 UTC (rev 288537)
@@ -436,9 +436,6 @@
 
 JSString* jsStringWithCacheSlowCase(VM& vm, StringImpl& stringImpl)
 {
-    if (JSString* string = vm.stringCache.get(&stringImpl))
-        return string;
-
     JSString* string = jsString(vm, String(stringImpl));
     vm.lastCachedString.set(vm, string);
     return string;

Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (288536 => 288537)


--- trunk/Source/_javascript_Core/runtime/VM.cpp	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp	2022-01-25 05:13:18 UTC (rev 288537)
@@ -218,7 +218,6 @@
     , propertyNames(nullptr)
     , emptyList(new ArgList)
     , machineCodeBytesPerBytecodeWordForBaselineJIT(makeUnique<SimpleStats>())
-    , stringCache(*this)
     , symbolImplToSymbolMap(*this)
     , structureCache(*this)
     , interpreter(nullptr)

Modified: trunk/Source/_javascript_Core/runtime/VM.h (288536 => 288537)


--- trunk/Source/_javascript_Core/runtime/VM.h	2022-01-25 04:59:14 UTC (rev 288536)
+++ trunk/Source/_javascript_Core/runtime/VM.h	2022-01-25 05:13:18 UTC (rev 288537)
@@ -585,7 +585,6 @@
     SmallStrings smallStrings;
     NumericStrings numericStrings;
     std::unique_ptr<SimpleStats> machineCodeBytesPerBytecodeWordForBaselineJIT;
-    WeakGCMap<StringImpl*, JSString, PtrHash<StringImpl*>> stringCache;
     Strong<JSString> lastCachedString;
     JSONAtomStringCache jsonAtomStringCache;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to