Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 87d58dfdc60bbb226863ca210198a028297fbd38
https://github.com/WebKit/WebKit/commit/87d58dfdc60bbb226863ca210198a028297fbd38
Author: Sosuke Suzuki <[email protected]>
Date: 2026-01-07 (Wed, 07 Jan 2026)
Changed paths:
A JSTests/microbenchmarks/array-from-map-entries-large.js
A JSTests/microbenchmarks/array-from-map-entries-small.js
A JSTests/microbenchmarks/array-from-map-keys-int-large.js
A JSTests/microbenchmarks/array-from-map-keys-int-small.js
A JSTests/microbenchmarks/array-from-map-values-int-large.js
A JSTests/microbenchmarks/array-from-map-values-int-small.js
A JSTests/stress/array-from-map-iterator.js
M Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Log Message:
-----------
[JSC] Add fast path for `Array.from(map.keys())` and
`Array.from(map.values())`
https://bugs.webkit.org/show_bug.cgi?id=304829
Reviewed by Yusuke Suzuki.
This patch adds a fast path for `Array.from(map.keys())` and
`Array.from(map.values())`
similar to the existing fast path for `Array.from(set)`.
TipOfTree Patched
array-from-map-keys-int-small 2.2366+-0.1882 ^ 0.8598+-0.0716
^ definitely 2.6013x faster
array-from-map-keys-int-large 50.5584+-1.1997 ^ 34.6662+-1.0034
^ definitely 1.4584x faster
array-from-map-values-int-small 2.3680+-0.1894 ^ 0.8556+-0.0100
^ definitely 2.7677x faster
array-from-map-values-int-large 50.5323+-1.0144 ^ 38.1210+-1.4224
^ definitely 1.3256x faster
* JSTests/microbenchmarks/array-from-map-entries-large.js: Added.
(test):
* JSTests/microbenchmarks/array-from-map-entries-small.js: Added.
(test):
* JSTests/microbenchmarks/array-from-map-keys-int-large.js: Added.
(test):
* JSTests/microbenchmarks/array-from-map-keys-int-small.js: Added.
(test):
* JSTests/microbenchmarks/array-from-map-values-int-large.js: Added.
(test):
* JSTests/microbenchmarks/array-from-map-values-int-small.js: Added.
(test):
* JSTests/stress/array-from-map-iterator.js: Added.
(shouldBe):
(shouldBeArray):
(testKeys):
(testValues):
(testEntries):
(noInline):
(shouldBe.Map.prototype.Symbol.iterator):
(mapIteratorPrototype.next):
(shouldBeArray.MyMap):
(shouldBe.const.fn2):
* Source/JavaScriptCore/runtime/ArrayConstructor.cpp:
(JSC::tryCreateArrayFromMapIterator): Added.
(JSC::JSC_DEFINE_HOST_FUNCTION):
Canonical link: https://commits.webkit.org/305250@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications