Skip to content

Refactor Intersection Iterator - [MOD-8842]#6322

Merged
GuyAv46 merged 20 commits intomasterfrom
guyav-refactor_intersection_iterator
Jun 18, 2025
Merged

Refactor Intersection Iterator - [MOD-8842]#6322
GuyAv46 merged 20 commits intomasterfrom
guyav-refactor_intersection_iterator

Conversation

@GuyAv46
Copy link
Collaborator

@GuyAv46 GuyAv46 commented Jun 15, 2025

Describe the changes in the pull request

Implementation is based on #5619

Micro-benchmarks show an improvement of up to 37%

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jun 15, 2025

Codecov Report

Attention: Patch coverage is 98.76543% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.80%. Comparing base (119d11a) to head (9033e4c).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/iterators/intersection_iterator.c 98.76% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6322      +/-   ##
==========================================
- Coverage   88.90%   88.80%   -0.11%     
==========================================
  Files         241      246       +5     
  Lines       40793    41143     +350     
  Branches     3435     3483      +48     
==========================================
+ Hits        36266    36536     +270     
- Misses       4491     4564      +73     
- Partials       36       43       +7     
Flag Coverage Δ
flow 81.65% <0.00%> (-0.71%) ⬇️
unit 46.60% <98.76%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@GuyAv46 GuyAv46 requested a review from Copilot June 16, 2025 10:01

This comment was marked as outdated.

@GuyAv46 GuyAv46 requested review from BenGoldberger and JoanFM June 16, 2025 13:03
Copy link
Collaborator

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for IT_V2 ? I think

@JoanFM
Copy link
Collaborator

JoanFM commented Jun 16, 2025

I cannot think now of a better way, but these multiple level loop seems hard to follow. Isn't there a way to make the loop over AgreeOnId more explicit?

@GuyAv46
Copy link
Collaborator Author

GuyAv46 commented Jun 17, 2025

There is no need for IT_V2? I think

I renamed the constructor NewIntersectionIterator instead of NewIntersectIterator to be more aligned with NewUnionIterator and more grammatically correct, so the IT_V2 macro is not required

I cannot think now of a better way, but these multiple level loop seems hard to follow. Isn't there a way to make the loop over AgreeOnId more explicit?

I don't think so, and it's better to maintain the current separation due to the differences in the outer loop when validation is required.
We must have 2 loops for the core logic

while (no agreement) {
    for (every child) {
        check if the current child has the current target ID
    }
}

@GuyAv46 GuyAv46 requested a review from Copilot June 17, 2025 06:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the intersection iterator implementation to improve performance and adds comprehensive tests and micro-benchmarks.

  • Refactoring of the intersection iterator logic and API
  • Addition of extensive unit tests to verify Read, SkipTo, and Rewind functionality
  • Inclusion of micro-benchmark tests to measure performance improvements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/cpptests/test_cpp_iterator_intersection.cpp Added tests verifying various iterator behaviors
tests/cpptests/micro-benchmarks/benchmark_intersection_iterator.cpp Added benchmarks to assess performance improvements
src/iterators/intersection_iterator.h Updated header defining the new intersection iterator API
src/iterators/intersection_iterator.c Refactored implementation of the intersection iterator

Copy link
Collaborator

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some naming suggestions (feel free to take or not), and small looping thing

@GuyAv46 GuyAv46 requested review from JoanFM and alonre24 June 17, 2025 08:18
@GuyAv46 GuyAv46 requested a review from BenGoldberger June 18, 2025 16:49
@GuyAv46 GuyAv46 added this pull request to the merge queue Jun 18, 2025
Merged via the queue into master with commit 9b2cdea Jun 18, 2025
22 checks passed
@GuyAv46 GuyAv46 deleted the guyav-refactor_intersection_iterator branch June 18, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants