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

Optimize db.clear() and db.iterator() #784

Merged
merged 5 commits into from
Sep 24, 2021
Merged

Optimize db.clear() and db.iterator() #784

merged 5 commits into from
Sep 24, 2021

Commits on Sep 24, 2021

  1. Make db.clear() 27x faster by doing it natively

    Because this uses an iterator under the hood, it also refactors
    shared code between `db.iterator()` and `db.clear()`.
    vweevers committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    b815bea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2958129 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d658099 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    30cfa75 View commit details
    Browse the repository at this point in the history
  5. Optimize db.iterator()

    By using `emplace_back()`, reusing the `std::vector` cache between
    `iterator.next()` calls, and not advancing the iterator prematurely.
    That last one only matters for single reads (i.e. the first `next()`
    call or one made after seeking) and it doesn't improve performance
    compared to the previous release, just undoes a mistake in b815bea.
    vweevers committed Sep 24, 2021
    Configuration menu
    Copy the full SHA
    9e146b5 View commit details
    Browse the repository at this point in the history