Skip to content

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