Changeset 288537 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jan 24, 2022, 9:13:18 PM (3 years ago)
Author:
Cameron McCormack
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:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r288532 r288537  
     12022-01-24  Cameron McCormack  <[email protected]>
     2
     3        Remove VM::stringCache
     4        https://bugs.webkit.org/show_bug.cgi?id=235536
     5
     6        Reviewed by Sam Weinig.
     7
     8        We consult VM::stringCache when creating a JSString, but since
     9        bug 142115 we never insert anything into it.
     10
     11        Removing this results in almost-significant improvements in the VueJS,
     12        Vanilla-ES2015, and jQuery sub-tests of Speedometer 2 (of 0.5-2%,
     13        0.03 <= p <= 0.05), and an almost significant 0.2% improvement in the
     14        overall score (p = 0.06).
     15
     16        * runtime/JSString.cpp:
     17        (JSC::jsStringWithCacheSlowCase):
     18        * runtime/VM.cpp:
     19        (JSC::VM::VM):
     20        * runtime/VM.h:
     21
    1222022-01-24  Diego Pino Garcia  <[email protected]>
    223
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r285730 r288537  
    437437JSString* jsStringWithCacheSlowCase(VM& vm, StringImpl& stringImpl)
    438438{
    439     if (JSString* string = vm.stringCache.get(&stringImpl))
    440         return string;
    441 
    442439    JSString* string = jsString(vm, String(stringImpl));
    443440    vm.lastCachedString.set(vm, string);
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r288085 r288537  
    219219    , emptyList(new ArgList)
    220220    , machineCodeBytesPerBytecodeWordForBaselineJIT(makeUnique<SimpleStats>())
    221     , stringCache(*this)
    222221    , symbolImplToSymbolMap(*this)
    223222    , structureCache(*this)
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r287582 r288537  
    586586    NumericStrings numericStrings;
    587587    std::unique_ptr<SimpleStats> machineCodeBytesPerBytecodeWordForBaselineJIT;
    588     WeakGCMap<StringImpl*, JSString, PtrHash<StringImpl*>> stringCache;
    589588    Strong<JSString> lastCachedString;
    590589    JSONAtomStringCache jsonAtomStringCache;
Note: See TracChangeset for help on using the changeset viewer.