Skip to content

Improve iterator performance and add better stream support #269

Description

@stroomdev66

I've implemented replacements for CursorIterable that appear to be faster. Raising this issue to coincide with the iterator-performance branch.

Activity

  1. self-assigned this
    on Nov 4, 2025
  2. added a commit that references this issue on Nov 4, 2025
  3. stroomdev66 commented on Nov 4, 2025

    @stroomdev66
    CollaboratorAuthor

    See draft PR #270

  4. stroomdev66 commented on Nov 4, 2025

    @stroomdev66
    CollaboratorAuthor

    My initial, and admittedly not very scientific, performance tests show the following improvements:

    Image

    The X axis shows different key ranges and the Y axis is milliseconds spent executing range scans.

  5. stroomdev66 commented on Nov 4, 2025

    @stroomdev66
    CollaboratorAuthor

    Another set of tests with 100M rows

    Image
  6. changed the title [-]Improve iterator performance and add better streaming support[/-] [+]Improve iterator performance and add better stream support[/+] on Nov 4, 2025
  7. added 8 commits that reference this issue on Nov 5, 2025
  8. cdprete commented on Feb 20, 2026

    @cdprete
    Contributor

    Very nice to see the support for Stream<T> now being offered 👍
    I will be able with this to drop some code from my side which was doing the same 😁

  9. bernardladenthin commented on Jul 24, 2026

    @bernardladenthin

    I spent some time reviewing the iterator-performance branch and opened a small follow-up PR stacked on it (targets iterator-performance, not master): #292.

    It fixes a couple of things in the new iterator/stream code and adds the missing test coverage:

    • Reverse prefix iteration could silently drop rows when the prefix ends in 0xFF. incrementLeastSignificantByte kept the trailing 0xFF ({0x01,0xFF} → {0x02,0xFF} instead of the tight {0x02}), so the reverse-prefix seek over-shot and iteration yielded nothing. Fixed across all four proxies, with a regression test.
    • LmdbStream's Spliterator advertised SORTED with a null comparator. Now reports ORDERED | NONNULL and getComparator() throws per the contract; the dead comparator stubs are removed.
    • KeyRange.getType() returned null for builder-created ranges (would NPE the legacy CursorIterable path) — now derives the equivalent KeyRangeType.
    • Added unit/integration coverage for the buffer-proxy prefix/int-key helpers, KeyRange builder, Dbi.newIterate/stream/getNameAsString, and the spliterator contract.

    Full suite is green (excluding the pre-existing flaky TestLmdbStreamBenchmark). The bigger design calls (API naming, retiring CursorIterable, rebasing, etc.) are intentionally left for you — noted in the PR. Happy to adjust anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementAdditional or new functionality

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions