https://github.com/lit/platform-benchmarks
Benchmarks of platform APIs and patterns
https://github.com/lit/platform-benchmarks
Last synced: 4 months ago
JSON representation
Benchmarks of platform APIs and patterns
- Host: GitHub
- URL: https://github.com/lit/platform-benchmarks
- Owner: lit
- License: bsd-3-clause
- Created: 2023-10-27T01:24:03.000Z (over 2 years ago)
- Default Branch: initial-benchmarks
- Last Pushed: 2025-09-12T19:45:18.000Z (9 months ago)
- Last Synced: 2025-09-25T03:43:37.329Z (9 months ago)
- Language: TypeScript
- Size: 564 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lit platform benchmarks
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.
## Benchmarks
### dirty-check-attributes
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
```sh
npm run bench:dirty-check-attributes
```
### dirty-check-text-content
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
## Future benchmarks
- Setting `.textContent` vs `.data`
- `append()` vs `insertBefore()`
- `template.innerHTML` vs `DOMParser`
- template clone vs imperative DOM construction
- Reusing TreeWalkers
- Finding nodes with TreeWalker + comments vs query selectors, etc