Skip to content

Use UnsignedBytes comparator from Guava #74

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

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

phearnot
Copy link
Contributor

UnsignedBytes.lexicographicalComparator from Guava offers better performance when comparing random byte strings, as well as in a worst case when byte strings differ only in the last bytes.

[info] Benchmark                                                       Mode  Cnt    Score   Error   Units
[info] ByteArrayComparePerformance.compareWithUnsignedBytesRandom     thrpt   20  102.230 ± 0.733  ops/ms
[info] ByteArrayComparePerformance.compareWithUnsignedBytesWorstCase  thrpt   20   79.906 ± 0.980  ops/ms
[info] ByteArrayComparePerformance.legacyCompareRandom                thrpt   20   82.349 ± 0.486  ops/ms
[info] ByteArrayComparePerformance.legacyCompareWorstCase             thrpt   20   20.998 ± 0.163  ops/ms

@kushti kushti merged commit 2bb9a5b into input-output-hk:master Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants