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

[kv] Use JDK9 Arrays#compare() to check bytes prefix for PrefixLookup #331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swuferhong
Copy link
Collaborator

Purpose

Linked issue: #271

Currently, RocksDBKv#isPrefixEquals() very inefficient to compare arrays byte by byte. Java9 provides a more efficient way Arrays.compare(compare(byte[] a, int aFromIndex, int aToIndex, byte[] b, int bFromIndex, int bToIndex)), underlying it leverages SIMD instructions.

As it is only supported since Java9, In this pr, we implement it based on the running jdk env (the method can get the running JDK environment, if Java9 use the support Arrays.compare() method).

Tests

API and Format

Documentation

@swuferhong swuferhong linked an issue Jan 21, 2025 that may be closed by this pull request
2 tasks
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.

[Feature] Use JDK9 Arrays.compare to check bytes prefix for PrefixLookup
1 participant