Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Immerjs vs Immutable 5.1.3 Perf Test
(version: 1)
Comparing performance of:
immer vs Immutable
Created:
6 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/immer/dist/immer.umd.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/immutable/5.1.3/immutable.js"></script>
Script Preparation code:
//const { fromJS } = require('immutable'); var data = { items: {}, count: 0, keys: [] } for (let index = 0; index < 100; index++) { data[index] = { id: index, name: `ITEM-${index}`, value: Math.random() } data.count++ data.keys.push(index) } var NEW_ITEM_ID = data.count +1 var produce = immer.default var im = Immutable.fromJS(data);
Tests:
immer
data = produce(data, draft => { draft.items[NEW_ITEM_ID] = { id: NEW_ITEM_ID, name: 'ITEM-NEW', value: 0 } draft.counter++ draft.keys.push(NEW_ITEM_ID) })
Immutable
var im = Immutable.fromJS(data); im = im.set('items', im.get('items').set(NEW_ITEM_ID, { id: NEW_ITEM_ID, name: 'ITEM-NEW', value: 0 })); im = im.set('count', im.count +1); im = im.set('keys', im.get('keys').push(NEW_ITEM_ID));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
immer
Immutable
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
immer
2643.4 Ops/sec
Immutable
522.9 Ops/sec
Related benchmarks:
Immer vs shallow copy vs Immutable
Immer vs Shallow copy vs Immutable Perf Test
Immer vs Shallow copy vs Immutable Perf Test 2
Immer vs Shallow copy vs Immutable Perf Test 3
Immerjs vs Shallow copy vs Immutable Perf Test
Immerjs vs Immutable Perf Test
Immerjs vs Immutable vs Shallow copy (performance test)
Immer vs Shallow copy vs Immutable Perf Test copy
Immer vs Shallow copy vs Immutable Perf Test updated
Comments
Confirm delete:
Do you really want to delete benchmark?