Skip to content

Instantly share code, notes, and snippets.

@DavidBruant
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBruant/e05fa653ce4b5033f8f9 to your computer and use it in GitHub Desktop.
Save DavidBruant/e05fa653ce4b5033f8f9 to your computer and use it in GitHub Desktop.
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