-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
https://github.com/zacharyvmm/1go
While still a work in progress, this library already outperforms comparable low-level libraries and Python bindings.
You can view the benchmarks here: https://github.com/zacharyvmm/1go/tree/main/benches.
I'm particularly excited about the query tree feature.
Since this implementation doesn't build a traditional tree structure, it must consolidate multiple queries into a single.
let html = "...";
let query = Query::first("div p.class", Save::none())
.then(|p| [
p.first("span", Save::none()),
p.all("a", Save::none())
]).build();
// "div p.class" -> "span"
// -> "a"
let map = parse(html, &[query]);Equivalent to:
const main = document.querySelector('main');
const first_span = main.querySelector('span');
const anchors = main.querySelectorAll('a');