Repository navigation
Commit f04a28c
authored
Avoid a per-run
## Summary
The prefill loops in the run-end bool decoder iterate with
`itertools::zip_eq`. `ZipEq::next` is generic and has no `#[inline]`, so
rustc emits each instantiation in a single codegen unit, and a loop in a
different unit has to call it out of line once per run. #10676 doesn't
touch the decoder, but it moves the decoder to another codegen unit in
the bench profile (16 codegen units, no LTO), and `decode_bool_nullable`
slows down by 17 to 25% in the CodSpeed simulation.
## Changes
The two prefill loops now use `zip`, like the sequential paths in the
same file. `runend_decode_bools` asserts once that the run ends and the
values have the same length. This keeps the panic that `zip_eq` raised
on a mismatch, and the few-runs paths now get it too. Every caller
passes the children of a `RunEndArray`, which already checks the lengths
at construction.
The x86-64 assembly of `vortex-array`, built with the CodSpeed
simulation flags at the head of #10676 plus this change, has no call to
`ZipEq::next`, even though the decoder is still in the other codegen
unit. On `develop`, the decoder's CodSpeed numbers already match the
inlined case, so this PR on its own may not show a change.
Signed-off-by: Connor Tsui <[email protected]>zip_eq call in run-end bool decoding (#10962)1 parent 891c01a commit f04a28c
1 file changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
| |||
171 | 184 | | |
172 | 185 | | |
173 | 186 | | |
174 | | - | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| |||
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
206 | | - | |
| 219 | + | |
207 | 220 | | |
208 | 221 | | |
209 | 222 | | |
| |||
0 commit comments