Repository navigation
Commit b7b01d3
Avoid redundant allocations in struct layout reader (#8851)
Pre-size the dtype and name vectors to their final length and push the
`validity` entry first, instead of collecting at field-count capacity
and then `insert(0, ..)`.
The previous code `collect`ed each `Vec` at exact field-count capacity,
then `insert(0, ..)` forced a reallocation **and** an O(n) shift of
every element. Both are now gone.
## Checks
- `cargo build -p vortex-layout` ✅
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Joe Isaacs <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>1 parent c5e075a commit b7b01d3
1 file changed
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
95 | 93 | | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| |||
0 commit comments