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

Fix performance bug in Java API get() functions when key is NotFound #13049

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Commits on Nov 19, 2024

  1. Add jmh benchmarks that test key not found

    Performance of NotFound case has been bad - see facebook#13023
    Some jmh tests to measure this, prior to fixing it.
    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    0ada1be View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    af798ac View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    60f2042 View commit details
    Browse the repository at this point in the history
  4. Fix NotFound performance for Java get()

    Handling NotFound should not go through the (horribly slow) C++ exception mechanism, because it is the expected/standard path in many cases.
    
    Change KVException::ThrowOnError to return a status when ok() or NotFound(), and the caller has to handle that status. Retain the exception mechanism for exceptions, it does simplifiy the flow and reduce checking.
    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    b67b1b8 View commit details
    Browse the repository at this point in the history
  5. NotFound performance of Java API transactional get

    get / getDirect / getForUpdate
    
    Repair performance by avoiding the C++ exception path on NotFound.
    Previous commit on this change altered behaviour of ROCKSDB_NAMESPACE::KVException::ThrowOnError to not throw on NotFound,
    this change is also necessary to reinstate correct behaviour.
    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    cc837a8 View commit details
    Browse the repository at this point in the history
  6. Fix getDirect() Java performance on NotFound

    Add extra tests for getDirect() —> NotFound where a potential gap existed
    Add a couple of extra tests around NotFound for comfort
    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    6eb8ae9 View commit details
    Browse the repository at this point in the history
  7. Format fixes

    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    527526e View commit details
    Browse the repository at this point in the history
  8. Tidy readme

    alanpaxton committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    2d826bd View commit details
    Browse the repository at this point in the history