Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96ca975b2a61a52093cccecd9249e2b410085eea
      
https://github.com/WebKit/WebKit/commit/96ca975b2a61a52093cccecd9249e2b410085eea
  Author: Sosuke Suzuki <[email protected]>
  Date:   2026-08-22 (Sat, 22 Aug 2026)

  Changed paths:
    A JSTests/microbenchmarks/object-assign-clone-multiple-sources.js
    A JSTests/stress/object-assign-clone-multiple-sources.js
    M Source/JavaScriptCore/runtime/ObjectConstructor.cpp

  Log Message:
  -----------
  [JSC] Use `objectCloneFast` for the first source in `Object.assign`'s 
batching path
https://bugs.webkit.org/show_bug.cgi?id=322161

Reviewed by Yusuke Suzuki.

Object.assign({}, state, patch) with 2 or 3 sources goes through the batching 
path in
objectConstructorAssign, which enumerates every source and replays the first 
source's
shape one property at a time via putOwnDataPropertyBatching. objectCloneFast is 
only
reachable from objectAssignFast, which is used for a single source or 5+ 
arguments.

Try objectCloneFast for the first source at the start of the batching path and 
start
the per-source loop from the second source when it succeeds. The batching path's
existing preconditions already satisfy what objectCloneFast requires.

                                               Baseline                  Patched

object-assign-clone-multiple-sources        0.9998+-0.0420     ^      
0.7104+-0.0486        ^ definitely 1.4073x faster
object-assign-multiple-sources              9.5170+-0.2249     ^      
6.2294+-0.2320        ^ definitely 1.5278x faster

Tests: JSTests/microbenchmarks/object-assign-clone-multiple-sources.js
       JSTests/stress/object-assign-clone-multiple-sources.js

* JSTests/microbenchmarks/object-assign-clone-multiple-sources.js: Added.
* JSTests/stress/object-assign-clone-multiple-sources.js: Added.
(shouldBe):
(shouldBeArray):
(makeState):
* Source/JavaScriptCore/runtime/ObjectConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):

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



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

Reply via email to