Commit 648a53a
committed
Smarter handling of input lines
Instead of using a Vec<String>, which allocates for each line, we
introduce a BufLines type which keeps the whole file in one allocation.
input/c_major.tab, repeated into a 25MB file, processed with muxml:
[OLD:]
measurement mean ± σ min … max outliers delta
wall_time 345ms ± 3.78ms 339ms … 354ms 0 ( 0%) 0%
peak_rss 462MB ± 126KB 462MB … 463MB 0 ( 0%) 0%
cpu_cycles 1.07G ± 20.7M 1.03G … 1.12G 0 ( 0%) 0%
instructions 3.56G ± 294 3.56G … 3.56G 0 ( 0%) 0%
cache_references 29.7M ± 1.10M 29.2M … 33.7M 1 ( 7%) 0%
cache_misses 3.19M ± 21.6K 3.17M … 3.24M 0 ( 0%) 0%
branch_misses 2.47M ± 160K 2.16M … 2.69M 0 ( 0%) 0%
[NEW:]
measurement mean ± σ min … max outliers delta
wall_time 329ms ± 2.72ms 322ms … 334ms 3 (19%) ⚡- 4.9% ± 0.7%
peak_rss 408MB ± 74.3KB 407MB … 408MB 0 ( 0%) ⚡- 11.9% ± 0.0%
cpu_cycles 1.03G ± 7.11M 1.02G … 1.04G 0 ( 0%) ⚡- 3.7% ± 1.1%
instructions 3.30G ± 365 3.30G … 3.30G 1 ( 6%) ⚡- 7.2% ± 0.0%
cache_references 23.7M ± 227K 23.4M … 24.3M 1 ( 6%) ⚡- 20.4% ± 1.9%
cache_misses 2.99M ± 20.7K 2.96M … 3.05M 1 ( 6%) ⚡- 6.5% ± 0.5%
branch_misses 1.79M ± 162K 1.55M … 2.08M 0 ( 0%) ⚡- 27.4% ± 4.8%
the same file, using the fixup backend:
[OLD:]
measurement mean ± σ min … max outliers delta
wall_time 164ms ± 2.00ms 160ms … 168ms 0 ( 0%) 0%
peak_rss 182MB ± 102KB 182MB … 183MB 0 ( 0%) 0%
cpu_cycles 528M ± 6.68M 519M … 543M 0 ( 0%) 0%
instructions 2.26G ± 254 2.26G … 2.26G 1 ( 3%) 0%
cache_references 18.2M ± 190K 17.9M … 19.1M 2 ( 6%) 0%
cache_misses 320K ± 11.6K 292K … 342K 0 ( 0%) 0%
branch_misses 1.27M ± 132K 1.15M … 1.66M 2 ( 6%) 0%
[NEW:]
measurement mean ± σ min … max outliers delta
wall_time 122ms ± 2.23ms 119ms … 128ms 0 ( 0%) ⚡- 25.4% ± 0.6%
peak_rss 107MB ± 123KB 107MB … 107MB 1 ( 2%) ⚡- 41.2% ± 0.0%
cpu_cycles 422M ± 7.88M 414M … 453M 1 ( 2%) ⚡- 20.1% ± 0.7%
instructions 1.87G ± 237 1.87G … 1.87G 0 ( 0%) ⚡- 17.1% ± 0.0%
cache_references 9.03M ± 65.9K 8.95M … 9.25M 1 ( 2%) ⚡- 50.4% ± 0.4%
cache_misses 165K ± 14.3K 101K … 179K 6 (15%) ⚡- 48.4% ± 2.0%
branch_misses 1.11M ± 122K 1.01M … 1.43M 6 (15%) ⚡- 13.2% ± 4.7%1 parent cf21572 commit 648a53a
File tree
12 files changed
+204
-134
lines changed- src
- backend
- fixup
- midi
- muxml
- parser
- tools
12 files changed
+204
-134
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | | - | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 130 | + | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
| |||
143 | 142 | | |
144 | 143 | | |
145 | 144 | | |
146 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
158 | | - | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
61 | 65 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
284 | | - | |
285 | | - | |
| 287 | + | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
| |||
308 | 310 | | |
309 | 311 | | |
310 | 312 | | |
311 | | - | |
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| 320 | + | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 23 | + | |
29 | 24 | | |
30 | 25 | | |
31 | 26 | | |
| |||
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 43 | + | |
53 | 44 | | |
54 | 45 | | |
55 | 46 | | |
| |||
77 | 68 | | |
78 | 69 | | |
79 | 70 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 71 | + | |
85 | 72 | | |
86 | 73 | | |
87 | 74 | | |
| |||
0 commit comments