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 (Windows NT 10.0; Win64; x64; rv:142.0) Gecko/20100101 Firefox/142.0
Browser:
Firefox 142
Operating system:
Windows
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
immer
92433.0 Ops/sec
spread
2063002.5 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];