diff --git a/benchmark/html/index.js b/benchmark/html/index.js new file mode 100644 index 0000000000..9921d08112 --- /dev/null +++ b/benchmark/html/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + parsing: require("./parsing") +}; diff --git a/benchmark/html/parsing.js b/benchmark/html/parsing.js new file mode 100644 index 0000000000..b4b693667f --- /dev/null +++ b/benchmark/html/parsing.js @@ -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 = ` +
+ ${"Some methods have unexpected implications for performance. ".repeat(5000)} +
`; +}); diff --git a/benchmark/index.js b/benchmark/index.js index 9040949d36..3c454aa195 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -2,7 +2,8 @@ module.exports = { jsdom: require("./jsdom"), - dom: require("./dom") + dom: require("./dom"), + html: require("./html") }; require("./prepare-suites")("", module.exports);