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 pages/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.
Documentation · Installation · Usage · Features
Benchmarks
Usage
Python
>>>
>>> =
>>> =
>>>
>>>
>>>
>>>
>>>
Rust
use ;
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
Credits
License
MIT or Apache 2.0 at your option.