Tests:
  • Object.assign

    AخA
     
    const a = { x: 'xxx', y: 1, z: null }
    const b = { z: 1, u: 'uuu', v: null }
    Object.assign(a, b);  
  • for in loop

     
    const a = { x: 'xxx', y: 1, z: null }
    const b = { z: 1, u: 'uuu', v: null }
    for (let prop in b)
      a[prop] = b[prop];
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object.assign
    for in loop

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 11 days ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36 EdgA/131.0.0.0
Chrome Mobile 131 on Android
View result in a separate tab
Test name Executions per second
Object.assign 6631004.0 Ops/sec
for in loop 6928677.5 Ops/sec