[webkit-changes] [WebKit/WebKit] 1f8437: [JSC] Add V8 style ICU DST offset cache
Yusuke Suzuki
noreply at github.com
Fri Jun 16 15:56:41 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1f84372b0336751caf1a2ae482a1331e754e6b51
https://github.com/WebKit/WebKit/commit/1f84372b0336751caf1a2ae482a1331e754e6b51
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2023-06-16 (Fri, 16 Jun 2023)
Changed paths:
M Source/JavaScriptCore/runtime/JSDateMath.cpp
M Source/JavaScriptCore/runtime/JSDateMath.h
M Source/WTF/wtf/DateMath.cpp
M Source/WTF/wtf/DateMath.h
M Source/WTF/wtf/GregorianDateTime.cpp
Log Message:
-----------
[JSC] Add V8 style ICU DST offset cache
https://bugs.webkit.org/show_bug.cgi?id=258186
rdar://110879575
Reviewed by Mark Lam.
This patch adds V8 style ICU DST offset cache into our DateCache.
Previously, we had one-way cache. But in some benchmarks, we observed
that frequent fallback to ICU due to cache miss. So we extend the cache
to 32-way LRU, which is what V8 is doing. So long as we hit this cache,
we do not need to query to ICU about DST offset.
* Source/JavaScriptCore/runtime/JSDateMath.cpp:
(JSC::DateCache::DSTCache::leastRecentlyUsed):
(JSC::DateCache::DSTCache::extendTheAfterCache):
(JSC::DateCache::DSTCache::localTimeOffset):
(JSC::DateCache::resetIfNecessarySlow):
(JSC::DateCache::localTimeOffset): Deleted.
* Source/JavaScriptCore/runtime/JSDateMath.h:
(JSC::LocalTimeOffsetCache::isEmpty):
(JSC::DateCache::DSTCache::DSTCache):
(JSC::DateCache::DSTCache::bumpEpoch):
(JSC::DateCache::DSTCache::reset):
(JSC::DateCache::localTimeOffset):
Canonical link: https://commits.webkit.org/265258@main
More information about the webkit-changes
mailing list