Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cde1f2154e51f70ec57fdbda493f10af88a7e291
https://github.com/WebKit/WebKit/commit/cde1f2154e51f70ec57fdbda493f10af88a7e291
Author: Sosuke Suzuki <[email protected]>
Date: 2026-07-14 (Tue, 14 Jul 2026)
Changed paths:
A JSTests/microbenchmarks/intl-datetimeformat-format-temporal-instant.js
A
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date-time.js
A JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date.js
A JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-time.js
A JSTests/microbenchmarks/intl-datetimeformat-format-temporal-style.js
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.h
Log Message:
-----------
[JSC] Use `IntlCache` for Temporal pattern generation in `Intl.DateTimeFormat`
https://bugs.webkit.org/show_bug.cgi?id=317624
Reviewed by Yusuke Suzuki.
computeAdjustDateTimeStyleFormat and computeGetDateTimeFormat call
udatpg_open directly every time a Temporal-specific UDateFormat is
created. udatpg_open loads the full set of CLDR patterns for the
locale and is one of the most expensive ICU calls.
initializeDateTimeFormat already uses vm.intlCache().getBestDateTimePattern
for the same purpose, which keeps a per-VM single-slot
UDateTimePatternGenerator cache. This patch makes the Temporal path
use the same helper.
Because IntlCache is a single-slot cache keyed by locale string, the
key built here must match the one used in initializeDateTimeFormat to
get a hit. m_calendar / m_numberingSystem are mutable and may be
filled in lazily by resolvedOptions() (since 312029@main), so
rebuilding the locale string at format time can produce a different
key and cause the cache to thrash. To avoid this, store the
dataLocaleWithExtensions CString computed in initializeDateTimeFormat
and reuse it as-is.
Baseline
Patched
intl-datetimeformat-format-temporal-style
102.6755+-1.6859 ^
34.4036+-0.4870 ^ definitely 2.9844x faster
intl-datetimeformat-format-temporal-plain-date
92.4857+-1.0609 ^
24.7306+-0.3581 ^ definitely 3.7397x faster
intl-datetimeformat-format-temporal-instant
95.9066+-0.9344 ^
28.4459+-0.3793 ^ definitely 3.3715x faster
intl-datetimeformat-format-temporal-plain-date-time
96.6132+-1.8707 ^
29.0148+-0.1834 ^ definitely 3.3298x faster
intl-datetimeformat-format-temporal-plain-time
92.9727+-0.5586 ^
24.8714+-0.2904 ^ definitely 3.7381x faster
Tests: JSTests/microbenchmarks/intl-datetimeformat-format-temporal-instant.js
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date-time.js
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date.js
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-time.js
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-style.js
* JSTests/microbenchmarks/intl-datetimeformat-format-temporal-instant.js: Added.
*
JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date-time.js:
Added.
* JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-date.js:
Added.
* JSTests/microbenchmarks/intl-datetimeformat-format-temporal-plain-time.js:
Added.
* JSTests/microbenchmarks/intl-datetimeformat-format-temporal-style.js: Added.
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::getTemporalFormatter const):
(JSC::IntlDateTimeFormat::computeTemporalFormatter const):
(JSC::IntlDateTimeFormat::computeAdjustDateTimeStyleFormat const):
(JSC::IntlDateTimeFormat::computeGetDateTimeFormat const):
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.h:
Canonical link: https://commits.webkit.org/317208@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications