Object Cloning

Benchmark published by System on

Description

Compare deep cloning methods.

Setup

const obj = { a: 1, b: { c: 2, d: [3, 4] }, e: 'string' };

Test Runner

Initializing...

Testing in
Test CaseOps/sec
JSON stringify/parse
const clone = JSON.parse(JSON.stringify(obj));
ready
structuredClone
const clone = structuredClone(obj);
ready

Revisions

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

Revision 1
publishedby Systemon