shallow cloning

Benchmark publishedon

Setup

const data = { x: -43432, y: 321, rotation: .43, scaleX:0.9, scaleY: 1.1, skewX: 1.2, skewY: 0.101321 };

Test Runner

Initializing...

Testing in
Test CaseOps/sec
structuredClone
const clone = structuredClone(data)
ready
spread destruct
const clone = {...data};
ready
manual 1
const { x, y, rotation, scaleX, scaleY, skewX, skewY } = data;
const clone = { x, y, rotation, scaleX, scaleY, skewX, skewY };
ready
manual 2
const clone = { x: data.x, y: data.y, rotation: data.rotation, scaleX: data.scaleX, scaleY: data.scaleY, skewX: data.skewX, skewY: data.skewY }
ready
manual 3
const { x, y, rotation, scaleX, scaleY, skewX, skewY } = data;
const clone = { x:x, y:y, rotation:rotation, scaleX:scaleX, scaleY:scaleY, skewX:skewX, skewY:skewY };
ready

Revisions

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

Revision 1
publishedon
Revision 2
publishedon
Revision 3
publishedon
Revision 4
publishedon