Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
immer push vs spread
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:146.0) Gecko/20100101 Firefox/146.0
Browser:
Firefox 146
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
4 months ago
Test name
Executions per second
immer
106790.0 Ops/sec
spread
2051297.1 Ops/sec
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];