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

Comparator: Add func: IsBytewiseComparator & IsReverseBytewiseComparator #15

Closed
rockeet opened this issue Oct 21, 2022 · 0 comments
Closed
Labels
enhancement New feature or request performance Improve performance

Comments

@rockeet
Copy link
Collaborator

rockeet commented Oct 21, 2022

This was a PR to upstream facebook/rocksdb#10645

Copied from facebook/rocksdb#10645

Virtual function call to comparator is very frequent thus is a hot spot
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:

devirtualize such virtual functions calls for BytewiseComparator or ReverseBytewiseComparator
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: facebook/rocksdb#10646 FindFileInRange devirtualization and prefix cache

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

Relevant commits

331715c leipeng 2022-09-19 19:26:36 +0800 Add Comparator::opt_cmp_type()
9327631 leipeng 2022-07-21 15:06:55 +0800 Merge branch 'sideplugin-7.04.0-415200d7' into sideplugin-7.06.0-a0c63083
27a169f leipeng 2022-06-20 21:40:41 +0800 IsBytewiseComparator: optimize add cmp type to Comparator
f033dac leipeng 2022-06-16 22:56:59 +0800 Add IsReverseBytewiseComparator()
5c62088 leipeng 2022-06-09 18:37:24 +0800 Merge branch 'sideplugin-7.01.0-a5e51305' into sideplugin-7.03.0-f85b31a2
b65e06f leipeng 2022-03-30 11:21:17 +0800 Merge branch 'sideplugin-6.28.0-677d2b4a' into sideplugin-7.01.0-a5e51305
de07870 leipeng 2021-12-31 14:35:01 +0800 Merge branch 'sideplugin-6.26.0-28bab0ef' into sideplugin-6.28.0-677d2b4a
8287e70 leipeng 2021-12-11 12:53:05 +0800 Move IsBytewiseComparator ... from topling-rocks to toplingdb repo

@rockeet rockeet added enhancement New feature or request performance Improve performance labels Oct 25, 2022
@rockeet rockeet closed this as completed Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Improve performance
Projects
None yet
Development

No branches or pull requests

1 participant