Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a5dd9753d23cbb42e61ea7bc85860d0e7ed586a6
https://github.com/WebKit/WebKit/commit/a5dd9753d23cbb42e61ea7bc85860d0e7ed586a6
Author: Sosuke Suzuki <[email protected]>
Date: 2026-02-07 (Sat, 07 Feb 2026)
Changed paths:
A JSTests/microbenchmarks/intl-date-time-format-to-parts.js
A JSTests/microbenchmarks/intl-list-format-to-parts.js
A JSTests/microbenchmarks/intl-number-format-range-to-parts.js
A JSTests/microbenchmarks/intl-number-format-to-parts.js
A JSTests/microbenchmarks/intl-number-format-unit-to-parts.js
M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
M Source/JavaScriptCore/Sources.txt
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
M Source/JavaScriptCore/runtime/IntlDurationFormat.cpp
M Source/JavaScriptCore/runtime/IntlListFormat.cpp
M Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
A Source/JavaScriptCore/runtime/IntlPartObject.cpp
A Source/JavaScriptCore/runtime/IntlPartObject.h
M Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
Log Message:
-----------
[JSC] Optimize Intl formatToParts methods with pre-built Structure
https://bugs.webkit.org/show_bug.cgi?id=306921
Reviewed by Yusuke Suzuki.
This patch optimizes the creation of part objects returned by Intl formatToParts
methods by using pre-built Structures, following the same pattern as
IntlSegmentDataObject (introduced in 31d781e338)
TipOfTree Patched
intl-number-format-range-to-parts 97.5536+-2.6448 ^
84.6148+-1.7409 ^ definitely 1.1529x faster
intl-number-format-unit-to-parts 220.2980+-13.2238
209.1234+-4.0800 might be 1.0534x faster
intl-number-format-to-parts 54.7243+-1.2841 ^
50.8049+-1.7732 ^ definitely 1.0771x faster
intl-list-format-to-parts 84.6818+-1.5119 ^
76.8525+-0.5202 ^ definitely 1.1019x faster
intl-date-time-format-to-parts 168.4584+-5.6350
161.2365+-9.2482 might be 1.0448x faster
Tests: JSTests/microbenchmarks/intl-date-time-format-to-parts.js
JSTests/microbenchmarks/intl-list-format-to-parts.js
JSTests/microbenchmarks/intl-number-format-range-to-parts.js
JSTests/microbenchmarks/intl-number-format-to-parts.js
JSTests/microbenchmarks/intl-number-format-unit-to-parts.js
* JSTests/microbenchmarks/intl-date-time-format-to-parts.js: Added.
(test):
* JSTests/microbenchmarks/intl-list-format-to-parts.js: Added.
(test):
* JSTests/microbenchmarks/intl-number-format-range-to-parts.js: Added.
(test):
* JSTests/microbenchmarks/intl-number-format-to-parts.js: Added.
(test):
* JSTests/microbenchmarks/intl-number-format-unit-to-parts.js: Added.
(test):
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts const):
(JSC::IntlDateTimeFormat::formatRangeToParts):
* Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:
(JSC::IntlDurationFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatRangeToPartsInternal):
(JSC::IntlNumberFormat::formatToPartsInternal):
* Source/JavaScriptCore/runtime/IntlPartObject.cpp: Added.
(JSC::createIntlPartObjectStructure):
(JSC::createIntlPartObjectWithSourceStructure):
(JSC::createIntlPartObjectWithUnitStructure):
(JSC::createIntlPartObjectWithUnitAndSourceStructure):
* Source/JavaScriptCore/runtime/IntlPartObject.h: Added.
(JSC::createIntlPartObject):
(JSC::createIntlPartObjectWithSource):
(JSC::createIntlPartObjectWithUnit):
(JSC::createIntlPartObjectWithUnitAndSource):
* Source/JavaScriptCore/runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::formatToParts const):
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::intlPartObjectStructure):
(JSC::JSGlobalObject::intlPartObjectWithSourceStructure):
(JSC::JSGlobalObject::intlPartObjectWithUnitStructure):
(JSC::JSGlobalObject::intlPartObjectWithUnitAndSourceStructure):
Canonical link: https://commits.webkit.org/306999@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications