Commit 35e2f6e
perf(reader): untranspose fastlanes.delta straight into the output window
Takes the better half of #343, which fixed #338 independently and in
parallel — I merged #345 for the same issue without checking for an open
PR first, so this reconciles the two rather than discarding one.
From #343:
- scatterChunk writes each untransposed value straight to its output
index, dropping the chunk-sized `untransposed` buffer #345 staged it
in and the separate pass that sliced it. The leading chunk of an
offset-sliced array maps to a negative index and the trailing chunk
runs past the row count; one `Long.compareUnsigned` covers both, since
a negative index reads as a huge unsigned value. The stores are a
permutation scatter and never vectorize regardless, so the compare
costs nothing the untranspose was not already paying.
- The returned segment is read-only.
- Element-indexed `getAtIndex` instead of hand-computed byte offsets.
- Reader-module tests that build the delta wire form directly, mirroring
DeltaEncodingEncoder's layout. These cover offset slicing where it
belongs — the writer is not on the reader's test classpath and never
emits a non-zero offset, so #345 had to reach into the integration
module to cover the same shape.
Kept from #345:
- Only chunks overlapping the row window are reconstructed. #343 walked
every chunk and discarded the out-of-window stores per element, so a
one-chunk slice of a thousand-chunk column did a thousand chunks of
work.
- The metadata range guard. Without it a `deltas_len` of Long.MAX_VALUE
drives the chunk loop ~9e15 times — a hang, which is worse than the
OutOfMemoryError it replaced.
Closes #343.
Co-Authored-By: Davide Angelocola <davide.angelocola@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 539aa14 commit 35e2f6e
2 files changed
Lines changed: 240 additions & 54 deletions
File tree
- reader/src
- main/java/io/github/dfa1/vortex/reader/decode
- test/java/io/github/dfa1/vortex/reader/decode
Lines changed: 69 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
103 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
104 | 136 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
110 | 162 | | |
111 | | - | |
112 | 163 | | |
113 | 164 | | |
114 | 165 | | |
| |||
159 | 210 | | |
160 | 211 | | |
161 | 212 | | |
162 | | - | |
| 213 | + | |
163 | 214 | | |
164 | 215 | | |
165 | 216 | | |
| |||
169 | 220 | | |
170 | 221 | | |
171 | 222 | | |
172 | | - | |
| 223 | + | |
173 | 224 | | |
174 | 225 | | |
175 | 226 | | |
176 | | - | |
| 227 | + | |
177 | 228 | | |
178 | 229 | | |
179 | 230 | | |
180 | 231 | | |
181 | | - | |
| 232 | + | |
182 | 233 | | |
183 | 234 | | |
184 | 235 | | |
185 | 236 | | |
186 | | - | |
| 237 | + | |
187 | 238 | | |
188 | 239 | | |
189 | 240 | | |
190 | 241 | | |
191 | | - | |
| 242 | + | |
192 | 243 | | |
193 | 244 | | |
194 | 245 | | |
195 | 246 | | |
196 | | - | |
| 247 | + | |
197 | 248 | | |
198 | 249 | | |
199 | 250 | | |
200 | 251 | | |
201 | | - | |
| 252 | + | |
202 | 253 | | |
203 | 254 | | |
204 | 255 | | |
205 | 256 | | |
206 | | - | |
| 257 | + | |
207 | 258 | | |
208 | 259 | | |
209 | 260 | | |
| |||
233 | 284 | | |
234 | 285 | | |
235 | 286 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | 287 | | |
273 | 288 | | |
Lines changed: 171 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
54 | 225 | | |
55 | 226 | | |
56 | 227 | | |
| |||
0 commit comments