Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cb1c48b3e95fb9670d91b400cc1111ea7b420dbe
      
https://github.com/WebKit/WebKit/commit/cb1c48b3e95fb9670d91b400cc1111ea7b420dbe
  Author: Yijia Huang <[email protected]>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    A JSTests/microbenchmarks/array-from-set-iterator.js
    A JSTests/stress/array-from-set-iterator-fast-path.js
    M Source/JavaScriptCore/runtime/ArrayConstructor.cpp

  Log Message:
  -----------
  [JSC] Extend Array.from()'s Set fast path to cover set.keys()/.values()
https://bugs.webkit.org/show_bug.cgi?id=320575
rdar://183552376

Reviewed by Yusuke Suzuki.

Array.from() already bypasses the generic iterator protocol for plain
Array.from(set) and Array.from(map.keys()/.values()), reading internal
hash-table storage directly. arrayConstructorPrivateFromFastWithoutMapFn
had a JSMapIteratorType case but no JSSetIteratorType case, so
Array.from(set.keys()) and Array.from(set.values()) never got the fast
path Map already had. Add tryCreateArrayFromSetIterator(), a mirror of
the existing tryCreateArrayFromMapIterator().

                                    ToT                     Patched

array-from-set-iterator        6.3581+-0.4507     ^      2.9109+-0.1796        
^ definitely 2.1842x faster

Tests: JSTests/microbenchmarks/array-from-set-iterator.js
       JSTests/stress/array-from-set-iterator-fast-path.js

Canonical link: https://commits.webkit.org/318251@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to