Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
weweewdwr41
Compare cloning element vs creating a new one
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/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
C1
250.5 Ops/sec
C2
240.0 Ops/sec
Script Preparation code:
function createExample() { var el = document.createElement('div'); el.className = 'class-1 class-2 class-3'; el.id = 'example'; el.textContent = 'Test'; return el; }
Tests:
C1
var scope = { ex: createExample() } var i = 10000; while (i--) { var e = scope.ex.cloneNode(true); }
C2
var scope = { ex: createExample() } scope.Clone = Node.prototype.cloneNode.bind(scope.ex); var i = 10000; while (i--) { var e = scope.Clone(true); }