rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Comparator: Add func: IsBytewiseComparator & IsReverseBytewiseComparator

Open rockeet opened this issue 3 years ago • 0 comments

  1. Virtual function call to comparator is very frequent thus is a hot spot
  2. In most use cases, the default BytewiseComparator or ReverseBytewiseComparator is used

This PR provide the basic support for our later PRs for FindFileInRange and MergingIterator:

  1. devirtualize such virtual functions calls for BytewiseComparator or ReverseBytewiseComparator
  2. Add prefix cache to omit most memcmp and indirect memory access to key

Performance of FindFileInRange was improved 20x+, MergingIterator was improved 3x+.

see PR: #10646 FindFileInRange devirtualization and prefix cache

PR MergingIterator depends on PR #9035 thus we would create it later.

rockeet avatar Sep 07 '22 06:09 rockeet