Skip to content

improve performance of the main-table path check during feature decoding#557

Merged
azahnen merged 2 commits into
masterfrom
nesting-tracker-mainpaths-set
Jul 10, 2026
Merged

improve performance of the main-table path check during feature decoding#557
azahnen merged 2 commits into
masterfrom
nesting-tracker-mainpaths-set

Conversation

@cportele

Copy link
Copy Markdown
Contributor

NestingTracker.isNotMain() is called for every value row while decoding and did a List<List<String>>.contains(path), i.e. a linear scan with element-wise list equality. Make the main-table paths a Set so the membership test is O(1), and build it as a Set at the source in FeatureDecoderSql (the only caller). The main table path repeats once per sub-query, so the Set also drops the many duplicates the List carried. Membership semantics are unchanged, so the decoded output is identical.

NestingTracker.isNotMain() is called for every value row while decoding and did
a List<List<String>>.contains(path), i.e. a linear scan with element-wise list
equality. Make the main-table paths a Set so the membership test is O(1), and
build it as a Set at the source in FeatureDecoderSql (the only caller). The main
table path repeats once per sub-query, so the Set also drops the many duplicates
the List carried. Membership semantics are unchanged, so the decoded output is
identical.
@cportele cportele requested a review from azahnen as a code owner June 29, 2026 11:11
@azahnen azahnen enabled auto-merge (squash) July 10, 2026 09:38
@azahnen azahnen merged commit ef139ad into master Jul 10, 2026
3 checks passed
@azahnen azahnen deleted the nesting-tracker-mainpaths-set branch July 10, 2026 09:43
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.

2 participants