Commit 4414ef7
committed
parser/pageparser: Store shortcode names as unique.Handle[string] to save memory allocations
```
│ stash.bench │ perf-pagelexer.bench │
│ sec/op │ sec/op vs base │
ShortcodeLexer-10 68.87µ ± ∞ ¹ 65.91µ ± ∞ ¹ ~ (p=0.200 n=4)
Parse-10 7.421µ ± ∞ ¹ 7.030µ ± ∞ ¹ -5.28% (p=0.029 n=4)
HasShortcode/Match-10 70.42n ± ∞ ¹ 77.37n ± ∞ ¹ +9.86% (p=0.029 n=4)
HasShortcode/NoMatch-10 14.32n ± ∞ ¹ 14.38n ± ∞ ¹ ~ (p=0.086 n=4)
geomean 847.2n 847.3n +0.01%
¹ need >= 6 samples for confidence interval at level 0.95
│ stash.bench │ perf-pagelexer.bench │
│ B/op │ B/op vs base │
ShortcodeLexer-10 181.3Ki ± ∞ ¹ 177.4Ki ± ∞ ¹ -2.19% (p=0.029 n=4)
Parse-10 24.56Ki ± ∞ ¹ 24.19Ki ± ∞ ¹ -1.53% (p=0.029 n=4)
HasShortcode/Match-10 0.000 ± ∞ ¹ 0.000 ± ∞ ¹ ~ (p=1.000 n=4) ²
HasShortcode/NoMatch-10 0.000 ± ∞ ¹ 0.000 ± ∞ ¹ ~ (p=1.000 n=4) ²
geomean ³ -0.93% ³
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
³ summaries must be >0 to compute geomean
│ stash.bench │ perf-pagelexer.bench │
│ allocs/op │ allocs/op vs base │
ShortcodeLexer-10 1004.0 ± ∞ ¹ 921.0 ± ∞ ¹ -8.27% (p=0.029 n=4)
Parse-10 34.00 ± ∞ ¹ 14.00 ± ∞ ¹ -58.82% (p=0.029 n=4)
HasShortcode/Match-10 0.000 ± ∞ ¹ 0.000 ± ∞ ¹ ~ (p=1.000 n=4) ²
HasShortcode/NoMatch-10 0.000 ± ∞ ¹ 0.000 ± ∞ ¹ ~ (p=1.000 n=4) ²
```1 parent a133393 commit 4414ef7
2 files changed
+12
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | | - | |
| 262 | + | |
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
| |||
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
| |||
0 commit comments