This repo contains a set of micro-benchmarks of basic platform APIs.
The benchmarks are useful to measure the performance fundamental operations across different DOM and JavaScript techniques and different browsers.
This benchmark measures the performance impact of dirty-checking values before calling `setAttribute()``.
It measures three techniques:
- always call `setAttribute()`` (no dirty-check)
- dirty check against the DOM (with
getAttribute()
) - dirty check against a stored JS value
npm run bench:dirty-check-attributes
This benchmark measures the performance impact of dirty-checking values
before setting Text.textContent
.
It measures three techniques:
- always call
textContent
(no dirty-check) - dirty check against the DOM
- dirty check against a stored JS value
- Setting
.textContent
vs.data
append()
vsinsertBefore()
template.innerHTML
vsDOMParser
- template clone vs imperative DOM construction
- Reusing TreeWalkers
- Finding nodes with TreeWalker + comments vs query selectors, etc