_.deepClone vs structuredClone

Benchmark created on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" type="text/javascript"><script>

Test runner

Ready to run.

Testing in
TestOps/sec
deepClone
const x = {
	y: {
		z: 'hello'
	}
}
const myClone = window._.deepClone(x)

console.log(myClone.y.z)
ready
structuredClone
const x = {
	y: {
		z: 'hello'
	}
}
const myClone = structuredClone(x)

console.log(myClone.y.z)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.