Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3302d7a4550490f246ee50dcd46fe4dd584a1c51
https://github.com/WebKit/WebKit/commit/3302d7a4550490f246ee50dcd46fe4dd584a1c51
Author: Vassili Bykov <[email protected]>
Date: 2026-08-20 (Thu, 20 Aug 2026)
Changed paths:
M Source/JavaScriptCore/parser/SourceProviderCache.cpp
M Source/JavaScriptCore/parser/SourceProviderCache.h
M Source/JavaScriptCore/runtime/VM.cpp
Log Message:
-----------
[JSC] Preallocate SourceProviderCache::m_map
https://bugs.webkit.org/show_bug.cgi?id=322139
rdar://185362748
Reviewed by Yusuke Suzuki.
SourceProviderCache includes a hash map (m_map) which currently starts out
empty. This patch
uses the source length to estimate and reserve some initial capacity and avoid
repetitive
reallocation and rehashing as the map is populated. The estimate is
deliberately conservative
and underestimates the final map size for the typical workload, to avoid
unnecessarily
increasing memory usage while still eliminating most of the rehashing churn.
Covered by existing tests.
Canonical link: https://commits.webkit.org/319532@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications