Skip to content

Commit

Permalink
HTML Parsing: Update measure script
Browse files Browse the repository at this point in the history
  • Loading branch information
triskweline committed Jun 27, 2018
1 parent e66d7a6 commit 69df105
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions design/measure_import_node.js
@@ -1,4 +1,4 @@
ITERATIONS = 100;
ITERATIONS = 5000;
CHUNK_SIZE = 10;

HTML = "<body>" + document.body.innerHTML + "</body>";
Expand Down Expand Up @@ -140,16 +140,26 @@ function removeScripts(doc) {
domParser = new DOMParser();


/*
experiment('PlainDOMParser', function() {
var doc = domParser.parseFromString(HTML, "text/html");
var body = doc.querySelector('body');
if (!body) {
throw "parsing failed";
}
});
*/

experiment('CreateHTMLDocument', function() {
var doc = document.implementation.createHTMLDocument('')
doc.documentElement.innerHTML = HTML;
var body = doc.querySelector('body');
if (!body) {
throw "parsing failed";
}
});



/*
experiment('DOMParserWithFixScripts', function() {
var doc = domParser.parseFromString(HTML, "text/html");
var body = doc.querySelector('body');
Expand All @@ -158,6 +168,7 @@ experiment('DOMParserWithFixScripts', function() {
}
fixScripts(body);
});
*/


/*
Expand All @@ -171,7 +182,7 @@ experiment('DOMParserWithImport', function() {
});
*/


/*
var noScriptPattern = /<noscript[^>]*>(.*?)<\/noscript>/i
experiment('DOMParserWitSmartFixScripts', function() {
Expand Down Expand Up @@ -313,7 +324,7 @@ experiment('SmartInnerHTMLWithRemoveScripts', function() {
removeScripts(body);
});

*/


pokeQueue();

0 comments on commit 69df105

Please sign in to comment.