simdhtml
A gigabytes fast HTML parser and selector, powered by Rust and SIMD.
Parsing has been a huge bottleneck for large-scale web crawlers. simdhtml brings native SIMD speed to the HTML extraction pipeline—10x faster than parsel, the scrapy default.
- Fast: Over 4000 page/s/core in real-world workloads, 7x-150x faster than commonly used parsers.
- Drop-in Replacement: Migrate from parsel by changing a single line of code.
- Standards: 98% WPT conformance in spec mode, while remaining significantly faster.
- Automatic: Adapt to available CPU features at runtime. No configuration needed.
- Reliable: Built in Rust, with
unsafestrictly confined to low-level SIMD intrinsics.
Python Docs · Rust Docs · Installation · Usage · Benchmarks
Performance results
Usage
Python
=
=
# 'First & best'
# '/one'
# '1'
The Python documentation covers the full selector API, the XPath subset and Scrapy integration.
Rust
use Selector;
Rust users can start at docs.rs/simdsel.
Development
We use xtask for automating chores.
# test parsel compatbility
# data management
# corpus tests (need `cargo xtask data`)
# sampled benchmark for fast iteration
# benchmark compared with other parsers
# plot performance graph
Roadmap
- More bindings: JS/C/CLI/Go
- Query aware parser: do not pay for unnecessary parsing
- Mutable support: so that we can support bs4 and dom like api
- GPU: large scale, offline analysis, but not of priority
Credits
License
MIT or Apache 2.0 at your option.