fallintoplace opened a new pull request, #1234:
URL: https://github.com/apache/arrow-go/pull/1234

   ### Rationale for this change
   
   Aligned multi-key sorts build the same `logicalRowMap` once per physical sort
   column. The map only depends on the shared chunk boundaries, so the extra 
maps
   use memory without adding any lookup information.
   
   ### What changes are included in this PR?
   
   - Detect aligned chunk boundaries before creating sort comparators.
   - Build one `logicalRowMap` for aligned multi-key columns.
   - Pass that map to each physical comparator.
   - Keep the existing per-column maps for misaligned and single-key sorts.
   
   ### Benchmark
   
   This uses the existing `BenchmarkSortIndices_Int64_TwoKeys` benchmark with
   65,536 rows and 64 aligned chunks.
   
   Median of three runs on an Apple M1 Pro with Go 1.26.3:
   
   | Case | Before | After |
   | --- | ---: | ---: |
   | Two aligned int64 keys | 12.65 ms/op, 3,165,232 B/op, 12 allocs/op | 12.39 
ms/op, 2,116,656 B/op, 11 allocs/op |
   
   Command:
   
   ```bash
   go test ./arrow/compute/internal/kernels -run '^$' -bench 
'^BenchmarkSortIndices_Int64_TwoKeys$' -benchmem -benchtime=200ms -count=3 
-cpu=1
   ```
   
   ### Are these changes tested?
   
   - `go test ./arrow/compute/internal/kernels -count=1`
   - `go test ./arrow/compute -count=1`
   - `go test -race ./arrow/compute/internal/kernels -count=1`
   - `go vet -composites=false ./arrow/compute/internal/kernels`
   


-- 
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]

Reply via email to