Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
immer push vs spread
(version: 1)
Comparing performance of:
immer vs spread
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/immer@9.0.13/dist/immer.umd.production.min.js"></script>
Script Preparation code:
const createList = () => Array.from({ length: 100 }, (_, i) => ({ id: i, value: `Item ${i}` })); const list = createList(); const nextItem = { id: "x", value: "I'm next" };
Tests:
immer
const updatedList = immer.produce(list, (draft) => { draft.push(nextItem); });
spread
const updatedList = [...list, nextItem];
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
immer
spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0
Browser/OS:
Firefox 146 on Ubuntu
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
immer
106790.0 Ops/sec
spread
2051297.1 Ops/sec
Related benchmarks:
Immer vs shallow copy
Immer vs Spread Reduce9
Immer@4 vs Spread Reduce
Immer vs shallow copy222ddd
Immer vs shallow copy222dddxxx
Lodash CloneDeep vs Immer Produce
Immer & Immutable benchmarks with inceremntal data
Immer freeze comparison2
Lodash CloneDeep vs Immer Produce latest
Comments
Confirm delete:
Do you really want to delete benchmark?