zeroshade commented on PR #1256:
URL: https://github.com/apache/arrow-go/pull/1256#issuecomment-5457879484
Rebased onto current `main`, which now carries both #1172 and #1220.
#1220 added an early return to `spacedExpand` once the decoded prefix is
already aligned. I mirrored it in `spacedExpandSwap` — at that point every
remaining swap is a self-swap, so the same reasoning applies and the two
functions stay consistent:
```go
idxDecode -= run.Length
// Once the decoded prefix is already aligned every remaining swap is a
// self-swap, so there is nothing left to do. Mirrors spacedExpand.
if idxDecode == run.Pos {
return numValues
}
```
Re-verified on the new base: the randomized differential test now compares
against the early-returning `spacedExpand` and still agrees at every valid
position while never leaving duplicates; the decoder-level regression test
still fails at all six widths without the fix, and the `pqarrow` round-trip
still fails without it. `parquet/...` passes in full and `golangci-lint`
reports 0 issues.
The earlier measurement stands: with #1172 now on `main`, `DecodeSpaced` is
0 allocs/op in steady state with this fix applied.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]