Last active
August 29, 2015 14:18
-
-
Save DavidBruant/e05fa653ce4b5033f8f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var NB = 30; | |
var start = performance.now(); | |
var doc; | |
for(var i = 0 ; i < NB ; i++){ | |
doc = new DOMParser().parseFromString(document.documentElement.outerHTML, "text/html") | |
} | |
console.log(performance.now() - start, 'ms') | |
start = performance.now(); | |
for(var i = 0 ; i < NB ; i++){ | |
doc = document.cloneNode(true); | |
} | |
console.log(performance.now() - start, 'ms') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment