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

   ### Rationale for this change
   
   `array.Diff` compares each matching pair by calling `SliceEqual` on two 
one-element slices. This creates temporary Arrow arrays for every non-null 
comparison.
   
   ### What changes are included in this PR?
   
   - Resolve a value comparator once when the Myers diff is created.
   - Compare booleans, integers, temporal values, strings, and binary values 
directly.
   - Keep floating-point, decimal, interval, and nested values on the existing 
`SliceEqual` fallback.
   - Preserve the existing null handling.
   - Add offset and null coverage for the direct comparison paths.
   - Add benchmarks for equal arrays and a change at the end of the input.
   
   Apple M1 Pro results with `GOMAXPROCS=1` and 65,536 values:
   
   | Case | Before | After |
   | --- | ---: | ---: |
   | Int64 equal | 18.4 ms | 0.65 ms |
   | Int64 changed last | 18.5 ms | 0.60 ms |
   | String equal | 20.3 ms | 0.74 ms |
   | String changed last | 20.5 ms | 0.73 ms |
   | Binary equal | 21.8 ms | 0.82 ms |
   | Binary changed last | 22.6 ms | 0.84 ms |
   
   The equal cases go from 262,147 allocations to 4 allocations per operation.
   
   ### Are these changes tested?
   
   - `go test ./...`
   - `go test -race ./arrow/array`
   - `go vet -composites=false ./arrow/array`
   
   ### Are there any user-facing changes?
   
   No.
   


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