Skip to content

[COLLECTIONS-722] Reuse the active path in nested iterator chains - #758

Open
rishabhdaim wants to merge 1 commit into
apache:masterfrom
rishabhdaim:codex/COLLECTIONS-722-chained-iterable
Open

rishabhdaim wants to merge 1 commit into
apache:masterfrom
rishabhdaim:codex/COLLECTIONS-722-chained-iterable

Conversation

@rishabhdaim

@rishabhdaim rishabhdaim commented Nov 25, 2026 •

Copy link
Copy Markdown

Reuse the active path through nested iterator chains between values. The eager and lazy overloads share iterative traversal while preserving lazy source access, shared-child iteration, and removal delegation.

The full Maven build passed on Java 21 with 22,552 tests reported, 82 skipped, and no failures.

JMH 1.37 on Java 21, building and draining chains of 256 values

Workload Before (master) After (this PR)
1,024-layer eager iterator chain 7.87 ms/op 33.3 µs/op
100,000-layer lazy iterator chain, 1 MiB stack Stack overflow 1.57 ms/op

COLLECTIONS-722 · Related iterable PR

OpenAI Codex assisted with the implementation, tests, and benchmarks.

@rishabhdaim rishabhdaim changed the title [COLLECTIONS-722] Fix nested chained iterable traversal [COLLECTIONS-722] Fix nested iterable and iterator traversal Nov 26, 2026
@rishabhdaim
rishabhdaim force-pushed the codex/COLLECTIONS-722-chained-iterable branch 2 times, most recently from 8e48477 to 48f9b2a Compare November 26, 2026 10:46
Share iterative traversal between eager and lazy iterator concatenation. Preserve lazy source access, shared child behavior, and removal delegation.

Assisted-By: OpenAI Codex
@rishabhdaim
rishabhdaim force-pushed the codex/COLLECTIONS-722-chained-iterable branch from 48f9b2a to 9400945 Compare November 26, 2026 11:31
@rishabhdaim rishabhdaim changed the title [COLLECTIONS-722] Fix nested iterable and iterator traversal [COLLECTIONS-722] Reuse the active path in nested iterator chains Nov 26, 2026
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.

1 participant