rusteerio 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +37 -37
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/{chunk-FPRP6UIX.mjs → chunk-HN63P3U7.mjs} +625 -401
- package/dist/chunk-HN63P3U7.mjs.map +1 -0
- package/dist/index.cjs +624 -400
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/slim.cjs +555 -407
- package/dist/slim.cjs.map +1 -1
- package/dist/slim.d.mts +2 -2
- package/dist/slim.d.ts +2 -2
- package/dist/slim.mjs +1 -1
- package/dist/{types-Cs9UP1Vv.d.mts → types-CJsc0PH-.d.mts} +12 -0
- package/dist/{types-Cs9UP1Vv.d.ts → types-CJsc0PH-.d.ts} +12 -0
- package/dist/utils.d.mts +1 -1
- package/dist/utils.d.ts +1 -1
- package/native/src/arena.rs +163 -7
- package/native/src/attributes.rs +18 -1
- package/native/src/codec.rs +79 -0
- package/native/src/lib.rs +117 -30
- package/native/src/snapshot.rs +144 -89
- package/native/src/tokenizer.rs +34 -20
- package/package.json +1 -1
- package/rusteerio.darwin-arm64.node +0 -0
- package/rusteerio.darwin-x64.node +0 -0
- package/rusteerio.linux-arm64-gnu.node +0 -0
- package/rusteerio.linux-arm64-musl.node +0 -0
- package/rusteerio.linux-x64-gnu.node +0 -0
- package/rusteerio.linux-x64-musl.node +0 -0
- package/rusteerio.win32-arm64-msvc.node +0 -0
- package/rusteerio.win32-x64-msvc.node +0 -0
- package/src/extract.ts +117 -24
- package/src/index.ts +27 -6
- package/src/match.ts +4 -4
- package/src/native.ts +4 -0
- package/src/nodes.ts +70 -10
- package/src/router.ts +80 -4
- package/src/selection.ts +18 -17
- package/src/snapshot.ts +37 -0
- package/src/transport.ts +1 -1
- package/dist/chunk-FPRP6UIX.mjs.map +0 -1
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -177,19 +177,19 @@ identical on all 5,000 pages, and times include loading.
|
|
|
177
177
|
|
|
178
178
|
| Measure | Result |
|
|
179
179
|
| --- | --- |
|
|
180
|
-
| Total time | Cheerio
|
|
181
|
-
| Pages where rusteerio was faster | **4,
|
|
182
|
-
| Per-page speedup, 10th / 50th / 90th percentile | 1.
|
|
183
|
-
| Slowest page | 0.
|
|
180
|
+
| Total time | Cheerio 15.9 s, rusteerio 7.7 s: **2.06× faster** |
|
|
181
|
+
| Pages where rusteerio was faster | **4,995 of 5,000** |
|
|
182
|
+
| Per-page speedup, 10th / 50th / 90th percentile | 1.30× / 1.62× / 1.98× |
|
|
183
|
+
| Slowest page | 0.90× |
|
|
184
184
|
|
|
185
|
-
The
|
|
185
|
+
The five slower pages (0.90× to 1.00×) measured 1.14× to 2.01× faster when
|
|
186
|
+
rerun with 25 samples each on another machine.
|
|
186
187
|
|
|
187
188
|
**Single operations.** `bench/operations.mjs` times 25 operations on freshly
|
|
188
189
|
loaded generated documents of 200 and 2,000 cards. Including each engine's load
|
|
189
|
-
time, rusteerio was faster for **
|
|
190
|
-
runs (median 1.
|
|
191
|
-
|
|
192
|
-
large document ranged from parity to 1.39× faster.
|
|
190
|
+
time, rusteerio was faster for **49 to 50 of 50** HTML measurements across two
|
|
191
|
+
runs (median 1.89–1.90×) and **48 of 50** XML measurements (median 1.84×). HTML
|
|
192
|
+
loading alone was 1.75–1.89× faster and XML loading 1.67–2.26× faster.
|
|
193
193
|
|
|
194
194
|
**Matched CPU budgets.** `bench/fair.mjs` gives both engines the same enforced
|
|
195
195
|
CPU budget; batch comparisons give Cheerio a reused Node worker pool and include
|
|
@@ -198,41 +198,41 @@ Rusteerio was faster in **all 45 cases**. Representative results:
|
|
|
198
198
|
|
|
199
199
|
| Workload | CPUs | Cheerio | rusteerio | rusteerio |
|
|
200
200
|
| --- | ---: | ---: | ---: | --- |
|
|
201
|
-
| Load/query, 500 articles | 1 |
|
|
202
|
-
| Load/query, 5,000 articles | 1 |
|
|
203
|
-
| HTML mutations, 5,000 articles | 1 |
|
|
204
|
-
| XML load/query, 5,000 articles | 1 |
|
|
205
|
-
| Extract 16 documents × 5,000 articles | 1 |
|
|
206
|
-
| Extract 16 documents × 5,000 articles | 8 |
|
|
207
|
-
| Nested callback extraction, 8 × 500 articles | 8 |
|
|
208
|
-
| Cold extraction, 16 × 20 articles | 8 |
|
|
209
|
-
| 8 concurrent batches × 8 × 300 articles | 8 |
|
|
210
|
-
| HTML stream, 50,000 elements | 1 | 1,
|
|
211
|
-
| XML stream, 50,000 elements | 8 |
|
|
212
|
-
| Append/update/remove, 4,000 cycles | 1 |
|
|
201
|
+
| Load/query, 500 articles | 1 | 36.53 ms | 3.37 ms | 10.82× faster |
|
|
202
|
+
| Load/query, 5,000 articles | 1 | 152.78 ms | 34.90 ms | 4.38× faster |
|
|
203
|
+
| HTML mutations, 5,000 articles | 1 | 241.28 ms | 68.12 ms | 3.54× faster |
|
|
204
|
+
| XML load/query, 5,000 articles | 1 | 65.28 ms | 15.24 ms | 4.28× faster |
|
|
205
|
+
| Extract 16 documents × 5,000 articles | 1 | 2,874.89 ms | 447.12 ms | 6.43× faster |
|
|
206
|
+
| Extract 16 documents × 5,000 articles | 8 | 805.16 ms | 122.93 ms | 6.55× faster |
|
|
207
|
+
| Nested callback extraction, 8 × 500 articles | 8 | 54.17 ms | 33.09 ms | 1.64× faster |
|
|
208
|
+
| Cold extraction, 16 × 20 articles | 8 | 15.19 ms | 3.17 ms | 4.79× faster |
|
|
209
|
+
| 8 concurrent batches × 8 × 300 articles | 8 | 127.82 ms | 23.94 ms | 5.34× faster |
|
|
210
|
+
| HTML stream, 50,000 elements | 1 | 1,086.17 ms | 297.04 ms | 3.66× faster |
|
|
211
|
+
| XML stream, 50,000 elements | 8 | 122.06 ms | 67.44 ms | 1.81× faster |
|
|
212
|
+
| Append/update/remove, 4,000 cycles | 1 | 613.95 ms | 388.99 ms | 1.58× faster |
|
|
213
213
|
|
|
214
214
|
Cold measurements include engine import, pool initialization and the first
|
|
215
215
|
batch.
|
|
216
216
|
|
|
217
217
|
**Where Cheerio can be faster.** Rusteerio builds node objects lazily from the
|
|
218
|
-
native tree,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
small pages can measure either way.
|
|
218
|
+
native tree, and an element's `attribs` is a `Proxy` so that assigning or
|
|
219
|
+
deleting a key changes the document, as it does in Cheerio. Code that visits
|
|
220
|
+
every node and enumerates every element's attributes (`Object.keys(node.attribs)`)
|
|
221
|
+
pays for creating those objects and for V8's slower key enumeration on proxies.
|
|
222
|
+
Including load, that walk measured 0.58–0.69× in XML, where Cheerio's
|
|
223
|
+
htmlparser2 parser leaves less load time to win back, and 1.00× or better in
|
|
224
|
+
HTML. Walking the same nodes without enumerating attributes is faster in both.
|
|
225
|
+
Very small pages can measure either way.
|
|
226
226
|
|
|
227
227
|
**Memory.** A batch extracting 16 documents of 5,000 articles with eight CPUs
|
|
228
|
-
ended at
|
|
229
|
-
HTML stream of 50,000 elements at 491 MB versus
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
documents. RSS includes initialization and resident input, and
|
|
235
|
-
not establish a universal memory bound.
|
|
228
|
+
ended at 581 MB RSS for rusteerio and 2,497 MB for Cheerio's worker pool, the
|
|
229
|
+
HTML stream of 50,000 elements at 491 MB versus 666 MB, and the large XML
|
|
230
|
+
load/query at 140 MB versus 147 MB. The XML stream ended higher, at 285 MB versus
|
|
231
|
+
221 MB, and the append/update/remove workload about even (93 MB versus 91 MB).
|
|
232
|
+
Linux builds use mimalloc, which keeps freed pages briefly for reuse; setting
|
|
233
|
+
`MIMALLOC_PURGE_DELAY=0` returns them at once and lowers stream RSS, at a cost in
|
|
234
|
+
speed for later documents. RSS includes initialization and resident input, and
|
|
235
|
+
sampled peaks do not establish a universal memory bound.
|
|
236
236
|
|
|
237
237
|
These results describe this VM and revision; hardware, runtime and input shape
|
|
238
238
|
affect them. See [the results](bench/results/2026-10-14/) and
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,7 +4,7 @@ This file preserves third-party license and attribution notices for the Rust nat
|
|
|
4
4
|
|
|
5
5
|
Generated by `node scripts/generate-notices.mjs` from `cargo metadata --locked`, crate license files, and the pinned supplemental sources recorded in `scripts/notices/sources.json`. It includes build dependencies and dependencies for all target platforms; a particular binary may use a subset. Identical notice texts are reproduced once and referenced below. The html5ever, markup5ever and html5gum crates contain local observer-hook and opt-in UTF-16 transport patches; their complete patched source and original notices are included in `native/vendor`. Other dependency source files are unmodified.
|
|
6
6
|
|
|
7
|
-
Cargo.lock SHA-256: `
|
|
7
|
+
Cargo.lock SHA-256: `b834f3bb9a4bb9e7889f20f789f80af645271bcfd0057cf4217843b17e3f5ae5`.
|
|
8
8
|
|
|
9
9
|
## Source availability
|
|
10
10
|
|