Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
singular clone vs batch clone
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
batch clone
15773.0 Ops/sec
singular clone
6643.7 Ops/sec
Script Preparation code:
const DIV = document.createElement('div') const SPN = document.createElement('span') const BTN = document.createElement('button') const INP = document.createElement('input') const H2 = document.createElement('h2') const H4 = document.createElement('h4') const AX = document.createElement('a') const UL = document.createElement('ul') const LI = document.createElement('li')
Tests:
batch clone
let u0 = UL.cloneNode(true) let l0 = LI.cloneNode(true) let l1 = LI.cloneNode(true) let l2 = LI.cloneNode(true) u0.appendChild(l0) u0.appendChild(l1) u0.appendChild(l2) for (let i = 0; i < 200; ++i) { let ui = u0.cloneNode(true) let uj = ui.firstElementChild; let uk = uj.nextElementSibling; let ul = uk.nextElementSibling; }
singular clone
for (let i = 0; i < 200; ++i) { let u0 = UL.cloneNode(true) let l0 = LI.cloneNode(true) let l1 = LI.cloneNode(true) let l2 = LI.cloneNode(true) u0.appendChild(l0) u0.appendChild(l1) u0.appendChild(l2) }
querySelectorAll
let u0 = UL.cloneNode(true) let l0 = LI.cloneNode(true) let l1 = LI.cloneNode(true) let l2 = LI.cloneNode(true) u0.appendChild(l0) u0.appendChild(l1) u0.appendChild(l2) l0.dataset.f00='1'; l1.dataset.f00='2'; l2.dataset.f00='3'; for (let i = 0; i < 200; ++i) { let ui = u0.cloneNode(true) let uj = ui.querySelectorAll('[data-f00]'); }