Skip to content

Add id-only member scans - #22

Merged
venkat1701 merged 6 commits into
mainfrom
perf/member-id-scans
Oct 4, 2026
Merged

venkat1701 merged 6 commits into
mainfrom
perf/member-id-scans

Conversation

@venkat1701

Copy link
Copy Markdown
Collaborator

Closes #8

Adds Hyperedge.memberIds() and Reader.memberIds(edge), which return a LongStream of member ids. Set edges read the membership tree keys directly; ordered edges read the incidences in position order. The Studio neighbourhood builder and the benchmark adapter now use it, since neither needs roles or weights.

Honest result: the win is smaller than the issue assumed. On a 200k member edge (same JVM, interleaved runs, median of 5 after warm-up) a full scan goes from 9.4 ms with members() to 6.9 ms with memberIds(), about 27% faster. The Member record was not the main cost. Most of the remaining time is the tree cursor and decoding the leaves, so closing the gap with HyperGraphDB's array scan will need a keys-only leaf decode path. I can open a separate issue for that if you want.

memberIdsFollowMembershipOrder in QueryLanguageTest checks that the ids match members() for set and ordered edges, including an ordered edge whose members aren't in id order. Full ./mvnw install and the benchmarks module both build locally.

@venkat1701
venkat1701 force-pushed the perf/member-id-scans branch from 325b66b to cfcd788 Compare October 4, 2026 08:18
@venkat1701
venkat1701 merged commit fe294df into main Oct 4, 2026
@venkat1701
venkat1701 deleted the perf/member-id-scans branch October 6, 2026 00:55
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.

Member scans allocate a record per member

1 participant