Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Compare ArrowBufPointers by unsinged integers #22678

Closed
asfimport opened this issue Aug 20, 2019 · 1 comment
Closed

[Java] Compare ArrowBufPointers by unsinged integers #22678

asfimport opened this issue Aug 20, 2019 · 1 comment

Comments

@asfimport
Copy link
Collaborator

Currently, ArrowBufPointers compare by bytes in lexicographic order. Another way is to compare by unsigned integers (longs, ints, & bytes). 

The second way involves additional bit operations for each iteration. However, it can compare 8 bytes at a time. So it is overall faster:

 

Compare by unsigned integers:

ArrowBufPointerBenchmarks.compareBenchmark avgt 5 65.722 ± 0.381 ns/op

 

Compare byte-wise:
ArrowBufPointerBenchmarks.compareBenchmark avgt 5 681.372 ± 0.604 ns/op

Reporter: Liya Fan / @liyafan82
Assignee: Liya Fan / @liyafan82

PRs and other links:

Note: This issue was originally created as ARROW-6297. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

Micah Kornfield / @emkornfield:
Issue resolved by pull request 5135
#5135

@asfimport asfimport added this to the 0.15.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants