Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
f0b64179-5b8a-4e67-be26-9080253f19af
(version: 1)
Comparing performance of:
immer.produce() vs structuredClone
Created:
8 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/immer@3.1.3/dist/immer.umd.min.js"></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script> <script src="https://cdn.jsdelivr.net/npm/uuid@8.3.2/dist/umd/uuidv4.min.js"></script>
Script Preparation code:
const numSiblings = 500; const depth = 3; state = { data: { data1: { data2: 'test', siblings: Array.from({ length: numSiblings }).map(() => ({ id: uuidv4() })), children: Array.from({ length: depth }).map(() => ({ id: uuidv4(), data: { data1: { data2: 'test', siblings: Array.from({ length: numSiblings }).map(() => ({ id: uuidv4() })), children: Array.from({ length: depth }).map(() => ({ id: uuidv4(), data: { data1: { data2: 'test', siblings: Array.from({ length: numSiblings }).map(() => ({ id: uuidv4() })), children: Array.from({ length: depth }).map(() => ({ id: uuidv4(), data: { data1: { data2: 'test', siblings: Array.from({ length: numSiblings }).map(() => ({ id: uuidv4() })), }, }, })), }, }, })), }, }, })), }, data3: Array.from({ length: 1000 }).map(() => ({})), }, };
Tests:
immer.produce()
const result = immer.produce(state, draft => draft.data.data1.data2 = 'qwe')
structuredClone
const result = structuredClone(state); result.data.data1.data2 = 'qwe';
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
immer.produce()
structuredClone
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
8 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser/OS:
Chrome 138 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
immer.produce()
0.0 Ops/sec
structuredClone
198.6 Ops/sec
Related benchmarks:
Object mapping vs array
ramda-transducer
forEach vs map123
testqwe
test with letter2
Test push spread map2
Test push spread map big
map initialisation
f0b64179-5b8a-4e67-be26-9080253f19a4
Comments
Confirm delete:
Do you really want to delete benchmark?