Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 01ea2a8eb95530c8af1ba9596658bc3acbfefc9e
      
https://github.com/WebKit/WebKit/commit/01ea2a8eb95530c8af1ba9596658bc3acbfefc9e
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    A JSTests/microbenchmarks/string-split-non-atom-subject.js
    M Source/JavaScriptCore/runtime/StringPrototype.cpp

  Log Message:
  -----------
  [JSC] `String#split` should not atomize the results of a non-atom subject
https://bugs.webkit.org/show_bug.cgi?id=320966

Reviewed by Yusuke Suzuki.

Splitting strings built at runtime (e.g. parsing CSV/log rows) is common, and 
such
subjects are not atom strings. stringSplitFast still atomized every 
identifier-like
result string and built an atom-strings array for them, even though the split 
cache
only accepts atom subjects, so the atomization was pure waste.

Only take the atomize-and-cache path when the subject is an atom, matching what
regExpSplitFast already does. Non-atom subjects now produce plain substrings.

With this change, elements of the result array are no longer atom strings when 
the
subject is not an atom. That being a performance regression is not a common 
case; we
confirmed that no such case exists in JetStream.

                                       base                    patched

string-split-non-atom-subject   156.1447+-4.6023     ^     41.2708+-0.7647      
  ^ definitely 3.7834x faster

Test: JSTests/microbenchmarks/string-split-non-atom-subject.js

* JSTests/microbenchmarks/string-split-non-atom-subject.js: Added.
(parseRow):
* Source/JavaScriptCore/runtime/StringPrototype.cpp:
(JSC::stringSplitFast):

Canonical link: https://commits.webkit.org/318764@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to