Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d84f22e0d2e4d4139c884566b32262d459194e82
https://github.com/WebKit/WebKit/commit/d84f22e0d2e4d4139c884566b32262d459194e82
Author: Vassili Bykov <[email protected]>
Date: 2025-05-08 (Thu, 08 May 2025)
Changed paths:
M Source/JavaScriptCore/runtime/StringPrototype.cpp
Log Message:
-----------
REGRESSION (291398@main): Slower String.prototype.split with result length <
100
https://bugs.webkit.org/show_bug.cgi?id=292147
rdar://150668072
Reviewed by Yijia Huang and Yusuke Suzuki.
The performance regression was caused by two prior optimizations that involve
adding JSStrings
to hash map in the VM, and the underlying AtomStringImpls to the atom string
registry.
https://github.com/WebKit/WebKit/pull/37941
https://github.com/WebKit/WebKit/pull/41448
In the specific benchmark reported in the bug, both actions incur the cost of
hashing and growing
these maps, which produces the observed regression. At the same time, the
optimizations improve
performance in the targeted browser benchmark suites.
The change set introduces an additional condition for applying the
optimizations. A string is only
promoted into an Identifier and registered with the VM if it can be a valid
identifier (does not
begin with a digit). This preserves the optimization required for the common
browser frameworks,
but avoids the costs in use case of parsing CSV files containing numeric data.
Additionally, there's a fix to defer GC for the duration of the registry update
in the empty string
code path.
* Source/JavaScriptCore/runtime/StringPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
Canonical link: https://commits.webkit.org/294689@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes