Skip to content

Commit 6becbb1

Browse files
committed
Add benchmarks section
1 parent a689566 commit 6becbb1

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,41 @@ import { snapdom, preCache } from './snapdom.mjs';
181181
* Iframes are not supported
182182
* When WebP format is used on Safari, it will fallback to PNG rendering.
183183
184+
## Benchmarks
185+
186+
`snapDOM` is not only highly accurate — it’s **extremely fast**.
187+
188+
189+
Latest benchmarks show significant performance improvements against other libraries:
190+
191+
| Scenario | vs. `modern-screenshot` | vs. `html2canvas` |
192+
| -------------------------------- | :---------------------: | :---------------: |
193+
| Small element (200×100) | 6.46× faster | 32.27× faster |
194+
| Modal size (400×300) | 7.28× faster | 32.66× faster |
195+
| Page view (1200×800) | 13.17× faster | 35.29× faster |
196+
| Large scroll area (2000×1500) | 38.23× faster | 68.85× faster |
197+
| Very large element (4000×2000) | 93.31× faster | 133.12× faster |
198+
| Complex small element (200×100) | 3.97× faster | 15.23× faster |
199+
| Complex modal (400×300) | 2.32× faster | 5.33× faster |
200+
| Complex page (1200×800) | 1.62× faster | 1.65× faster |
201+
| Complex large scroll (2000×1500) | 1.66× faster | 1.24× faster |
202+
| Complex very large (4000×2000) | 1.52× faster | 1.28× faster |
203+
204+
205+
### Run the benchmarks
206+
207+
To run these benchmarks yourself:
208+
209+
```sh
210+
git clone https://github.com/zumerlab/snapdom.git
211+
cd snapdom
212+
npm install
213+
npm run test:benchmark
214+
```
215+
216+
They execute in **headless Chromium** using real DOM nodes.
217+
218+
184219
## License
185220
186221
MIT © Zumerlab

0 commit comments

Comments
 (0)