Skip to content

Commit

Permalink
Add benchmark for creating a large text node
Browse files Browse the repository at this point in the history
  • Loading branch information
Zirro authored and domenic committed Dec 2, 2018
1 parent ac1886b commit 4ec79d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions benchmark/html/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"use strict";

module.exports = {
parsing: require("./parsing")
};
12 changes: 12 additions & 0 deletions benchmark/html/parsing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use strict";
const suite = require("../document-suite");

// Measures the time spent parsing and creating a large text node
// https://github.com/jsdom/jsdom/pull/2419

exports.text = suite(document => {
document.body.innerHTML = `
<p>
${"Some methods have unexpected implications for performance. ".repeat(5000)}
</p>`;
});
3 changes: 2 additions & 1 deletion benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

module.exports = {
jsdom: require("./jsdom"),
dom: require("./dom")
dom: require("./dom"),
html: require("./html")
};

require("./prepare-suites")("", module.exports);

0 comments on commit 4ec79d5

Please sign in to comment.