Use vectorizable byte array comparison in DataComparator [HZ-2885] by k-jamroz · Pull Request #25196 · hazelcast/hazelcast (original) (raw)
DataComparator compares Data using custom implemented code, byte by byte, instead of using method from JVM which can use vectorization and intrinsics.
This affects:
- Sorted index in general (is used by
OrderedIndexStore), but the difference could be visible with very large number of index operations on big IMap or with long keys with similar prefix.OrderedIndexStoreusesConcurrentSkipListMapandTreeMapwithDataComparatoras key comparator, so the number of comparisons per operation is relatively small. - Sorted index scan in SQL when there more that FETCH_SIZE_HINT (128) rows with same key - in that case we skip some rows by comparing keys as
Data. This is very bad case for index scan (HZ-2881) and the difference is better visible: approx. 10% improvement - but this highly depends on setup, length of the key etc.
Additional factor is that Data has common prefix of 12 bytes which will be usually the same.
Fixes HZ-2885
Checklist:
- Labels (
Team:,Type:,Source:,Module:) and Milestone set - Label
Add to Release NotesorNot Release Notes contentset - Request reviewers if possible
- Send backports/forwardports if fix needs to be applied to past/future releases