HTML Preparation code:
AخA
 
1
<script src="https://cdnjs.cloudflare.com/ajax/libs/immutable/3.8.2/immutable.min.js"></script>
2
<script src="https://cdn.jsdelivr.net/npm/immutability-helper@2.7.0/index.min.js"></script>
Tests:
  • object spread

    x
     
    let obj = {};
    for (let i = 0; i < 10000; i++){
      const key = 'key'+i
      const value = 'value'+i
      obj = {...obj, [key]: {key, value}}
    }
  • immutable-js

     
    let obj = Immutable.Map();
    for (let i = 0; i < 10000; i++){
      const key = 'key'+i
      const value = 'value'+i
      obj = obj.set(key, {key, value})
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    object spread
    immutable-js

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36
Chrome 109 on Windows
View result in a separate tab
Test name Executions per second
object spread 0.0 Ops/sec
immutable-js 47.6 Ops/sec