Skip to content

Commit 5486cd2

Browse files
committed
Explain text span usage
1 parent 7cfb6a2 commit 5486cd2

File tree

4 files changed

+130
-87
lines changed

4 files changed

+130
-87
lines changed

DOCUMENTATION.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,39 +187,55 @@ Warning: throughput numbers are not conformance claims. This parser is permissiv
187187

188188
<!-- BENCHMARK_SNAPSHOT:START -->
189189

190-
Source: `bench/results/latest.json` (`stable` profile).
190+
Source: `bench/results/latest.json` (`quick` profile).
191191

192192
#### Parse Throughput Comparison (MB/s)
193193

194-
| Fixture | ours-fastest | ours-strictest | lol-html | lexbor |
195-
|---|---:|---:|---:|---:|
196-
| `rust-lang.html` | 1793.63 | 1805.72 | 1485.65 | 338.79 |
197-
| `wiki-html.html` | 1592.09 | 1626.85 | 1197.90 | 267.40 |
198-
| `mdn-html.html` | 2665.37 | 2631.01 | 1840.10 | 405.93 |
199-
| `w3-html52.html` | 1041.27 | 1067.65 | 739.42 | 197.44 |
200-
| `hn.html` | 1262.78 | 1223.22 | 858.51 | 222.01 |
194+
| Fixture | ours | lol-html | lexbor |
195+
|---|---:|---:|---:|
196+
| `rust-lang.html` | 1268.48 | 1014.95 | 235.85 |
197+
| `wiki-html.html` | 1201.71 | 997.62 | 230.75 |
198+
| `mdn-html.html` | 2048.73 | 1476.83 | 327.76 |
199+
| `w3-html52.html` | 880.85 | 709.20 | 176.47 |
200+
| `hn.html` | 1139.01 | 838.57 | 215.48 |
201+
| `python-org.html` | 12842.89 | 3125.54 | 512.60 |
202+
| `kernel-org.html` | 1421.24 | 1180.06 | 270.49 |
203+
| `gnu-org.html` | 1767.56 | 1223.40 | 281.50 |
204+
| `ziglang-org.html` | 1315.18 | 1028.18 | 253.44 |
205+
| `ziglang-doc-master.html` | 920.71 | 851.15 | 210.79 |
206+
| `wikipedia-unicode-list.html` | 1280.31 | 994.43 | 199.70 |
207+
| `whatwg-html-spec.html` | 856.61 | 810.04 | 196.23 |
208+
| `synthetic-forms.html` | 975.65 | 717.80 | 148.20 |
209+
| `synthetic-table-grid.html` | 696.44 | 699.27 | 138.77 |
210+
| `synthetic-list-nested.html` | 856.61 | 627.55 | 156.74 |
211+
| `synthetic-comments-doctype.html` | 1323.85 | 775.32 | 191.61 |
212+
| `synthetic-template-rich.html` | 631.79 | 399.83 | 129.11 |
213+
| `synthetic-whitespace-noise.html` | 983.29 | 877.60 | 147.90 |
214+
| `synthetic-news-feed.html` | 702.18 | 573.83 | 123.64 |
215+
| `synthetic-ecommerce.html` | 690.67 | 509.90 | 128.91 |
216+
| `synthetic-forum-thread.html` | 743.85 | 631.43 | 138.34 |
201217

202218
#### Query Match Throughput (ours)
203219

204-
| Case | strictest ops/s | strictest ns/op | fastest ops/s | fastest ns/op |
205-
|---|---:|---:|---:|---:|
206-
| `attr-heavy-button` | 1096635.57 | 911.88 | 1157408.79 | 864.00 |
207-
| `attr-heavy-nav` | 1096348.31 | 912.12 | 1240981.35 | 805.81 |
220+
| Case | ours ops/s | ours ns/op |
221+
|---|---:|---:|
222+
| `attr-heavy-button` | 1237399.82 | 808.15 |
223+
| `attr-heavy-nav` | 1124363.32 | 889.39 |
208224

209225
#### Cached Query Throughput (ours)
210226

211-
| Case | strictest ops/s | strictest ns/op | fastest ops/s | fastest ns/op |
212-
|---|---:|---:|---:|---:|
213-
| `attr-heavy-button` | 1251564.49 | 799.00 | 1429552.76 | 699.52 |
214-
| `attr-heavy-nav` | 1268503.74 | 788.33 | 1459951.22 | 684.95 |
227+
| Case | ours ops/s | ours ns/op |
228+
|---|---:|---:|
229+
| `attr-heavy-button` | 1190918.72 | 839.69 |
230+
| `attr-heavy-nav` | 1160560.94 | 861.65 |
215231

216232
#### Query Parse Throughput (ours)
217233

218234
| Selector case | Ops/s | ns/op |
219235
|---|---:|---:|
220-
| `simple` | 18369247.97 | 54.44 |
221-
| `complex` | 6344494.00 | 157.62 |
222-
| `grouped` | 6762290.76 | 147.88 |
236+
| `simple` | 18459598.22 | 54.17 |
237+
| `complex` | 6121884.27 | 163.35 |
238+
| `grouped` | 7212833.22 | 138.64 |
223239

224240
For full per-parser, per-fixture tables and gate output:
225241
- `bench/results/latest.md`

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ Performance numbers are **not** conformance claims. The parser is intentionally
1818

1919
<!-- README_AUTO_SUMMARY:START -->
2020

21-
Source: `bench/results/latest.json` (`stable` profile).
21+
Source: `bench/results/latest.json` (`quick` profile).
2222

2323
### Parse Throughput (Average Across Fixtures)
2424

2525
```text
26-
ours-fastest │████████████████████│ 1671.03 MB/s (100.00%)
27-
ours-strictest │████████████████████│ 1670.89 MB/s (99.99%)
28-
lol-html │███████████████░░░░░│ 1224.32 MB/s (73.27%)
29-
lexbor │███░░░░░░░░░░░░░░░░░│ 286.31 MB/s (17.13%)
26+
ours │████████████████████│ 1645.13 MB/s (100.00%)
27+
lol-html │████████████░░░░░░░░│ 955.36 MB/s (58.07%)
28+
lexbor │███░░░░░░░░░░░░░░░░░│ 210.20 MB/s (12.78%)
3029
```
3130

3231
### Conformance Snapshot

bench/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,32 @@ It also benchmarks `htmlparser` query parsing throughput (runtime selector compi
1010
Query sections remain `htmlparser`-only; external parser comparisons are parse throughput only.
1111
`query-parse` is mode-independent and is measured once (`ours`) to avoid duplicate compatibility rows.
1212

13-
`htmlparser` parse results are reported in two internal benchmark modes:
13+
`htmlparser` parse/query benchmark results are reported as:
1414

15-
- `ours-strictest`: most-work parse option bundle
16-
- `ours-fastest`: least-work parse option bundle (lazy child views + whitespace text-node dropping)
15+
- `ours`: fastest parse option bundle (lazy child views + whitespace text-node dropping)
1716

1817
Default fixture set includes:
1918
- `rust-lang.html`
2019
- `wiki-html.html`
2120
- `mdn-html.html`
2221
- `w3-html52.html`
2322
- `hn.html`
23+
- `python-org.html`
24+
- `kernel-org.html`
25+
- `gnu-org.html`
26+
- `ziglang-org.html`
27+
- `ziglang-doc-master.html`
28+
- `wikipedia-unicode-list.html`
29+
- `whatwg-html-spec.html`
30+
- `synthetic-forms.html`
31+
- `synthetic-table-grid.html`
32+
- `synthetic-list-nested.html`
33+
- `synthetic-comments-doctype.html`
34+
- `synthetic-template-rich.html`
35+
- `synthetic-whitespace-noise.html`
36+
- `synthetic-news-feed.html`
37+
- `synthetic-ecommerce.html`
38+
- `synthetic-forum-thread.html`
2439

2540
## Setup
2641

@@ -67,4 +82,4 @@ Results are written to:
6782

6883
The benchmark output also includes a hard gate table:
6984

70-
- `PASS/FAIL: ours-fastest > lol-html` per fixture
85+
- `PASS/FAIL: ours > lol-html` per fixture

0 commit comments

Comments
 (0)