iceberg-kitten opened a new pull request, #1634:
URL: https://github.com/apache/arrow-go/pull/1634

   ### Why
   Default float sorting uses comparison sort even on large single-chunk 
columns.
   
   ### What
   Use stable radix sorting for Float16, Float32, and Float64 columns with at 
least 2,048 rows.
   
   ### Implementation
   Encode values as ordered integer keys and reuse the radix sorter. Preserve 
null and NaN placement, signed-zero equality, and stable ties.
   
   ### Benchmark
   
   Sort 65,536 Float64 rows with default float ordering and nulls at the end. 
Nulls occur every 31 rows and NaNs every 97 rows in the cases that include 
them. The chunked control has 16 chunks. The single-chunk cases use 50% more 
allocated bytes per operation. The chunked control showed no statistically 
clear timing change.
   
   | Input | Time/op before → after | Change | B/op | Allocs/op |
   | --- | ---: | ---: | ---: | ---: |
   | Finite, ascending | 27.4 → 3.31 ms | -87.9% | 1,065,392 → 1,597,952 | 6 → 
8 |
   | Finite, descending | 30.2 → 3.31 ms | -89.0% | 1,065,392 → 1,597,952 | 6 → 
8 |
   | NaNs, ascending | 28.1 → 3.06 ms | -89.1% | 1,065,392 → 1,597,952 | 6 → 8 |
   | NaNs, descending | 28.6 → 3.01 ms | -89.5% | 1,065,392 → 1,597,952 | 6 → 8 
|
   | Nulls and NaNs, ascending | 30.5 → 3.13 ms | -89.7% | 1,065,392 → 
1,597,952 | 6 → 8 |
   | Nulls and NaNs, descending | 31.3 → 3.24 ms | -89.7% | 1,065,392 → 
1,597,952 | 6 → 8 |
   | 16 chunks, nulls and NaNs, ascending | 29.2 → 29.3 ms | +0.3% | 2,114,480 
| 9 |
   | 16 chunks, nulls and NaNs, descending | 31 → 30.7 ms | -0.9% | 2,114,480 | 
9 |
   
   Medians of 8 runs per revision on Linux amd64, Intel Core i9-12900HK, Go 
1.26.11, pinned to one efficiency core. Baseline is `main` at `aba35416`. Use 
the same benchmark on both revisions. Copy the PR's benchmark file into the 
baseline checkout before running.
   
   ```sh
   go test ./arrow/compute/internal/kernels -run '^$' -bench 
'^BenchmarkSortIndicesFloat64DefaultRadix$/^(finite|nans|nulls-and-nans|chunked-control)$'
 -benchmem -benchtime=120ms -count=8 -cpu=1
   ```
   


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