Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
klona vs structuredClone vs JSON.parse(JSON.stringify())
(version: 1)
https://developer.mozilla.org/en-US/docs/Web/API/structuredClone
Comparing performance of:
klona vs Native structuredClone vs JSON.parse(JSON.stringify())
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script src='https://unpkg.com/klona@2.0.6/json/index.min.js'></script>
Script Preparation code:
var MyObject = { description: 'Creates a deep copy of source, which should be an object or an array.', myNumber: 123456789, myBoolean: true, jayson: { stringify: 'JSON.stringify() method converts a JavaScript value to a JSON string....', parse: 'JSON.parse() method parses a JSON string...' } }; var myCopy = null;
Tests:
klona
myCopy = klona.klona(MyObject);
Native structuredClone
myCopy = structuredClone(MyObject);
JSON.parse(JSON.stringify())
myCopy = JSON.parse(JSON.stringify(MyObject));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
klona
Native structuredClone
JSON.parse(JSON.stringify())
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Mobile Safari/537.36
Browser/OS:
Chrome Mobile 136 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
klona
4380840.5 Ops/sec
Native structuredClone
400968.7 Ops/sec
JSON.parse(JSON.stringify())
1165241.1 Ops/sec
Comments
Confirm delete:
Do you really want to delete benchmark?