Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ffad432a5d1ae43bf7753bc7cfac2068f36f468f
https://github.com/WebKit/WebKit/commit/ffad432a5d1ae43bf7753bc7cfac2068f36f468f
Author: Sosuke Suzuki <[email protected]>
Date: 2025-12-05 (Fri, 05 Dec 2025)
Changed paths:
A JSTests/microbenchmarks/string-prototype-concat-2-args.js
M Source/JavaScriptCore/builtins/StringPrototype.js
Log Message:
-----------
[JSC] Optimize 2 args `String#concat` call
https://bugs.webkit.org/show_bug.cgi?id=303605
Reviewed by Yusuke Suzuki.
This patch changes to optimize 2 args `String#concat`.
Transpilers like Babel transpile template literals such as `${foo}${bar}`
into a 2 args `String#concat`[1]. In fact, `wasm/tfjs-bundle.js` from JetStream3
contains hundreds of 2 arguments `String#concat`.
TipOfTree Patched
string-prototype-concat-2-args 7.8642+-0.3652 ^ 1.9200+-0.2046
^ definitely 4.0960x faster
[1]:
https://babeljs.io/repl#?config_lz=N4IgZglgNgpgdgQwLYxALhAJxgBygOgCsBnEAGhB22JgBdS0BtRkeAN3NFoUwHM6GICDAAEARjHkQSAPYATAK6wGYBFBoBfALpaKxGQswBjGABUAnjlQZZi2CA1A&code_lz=AYEg3gZg9lC-4CMCGAnWwDcQ&lineWrap=true&version=7.28.5
Test: JSTests/microbenchmarks/string-prototype-concat-2-args.js
* JSTests/microbenchmarks/string-prototype-concat-2-args.js: Added.
* Source/JavaScriptCore/builtins/StringPrototype.js:
(concat):
Canonical link: https://commits.webkit.org/303971@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications