[Python] Speed up ApproximateUnique accumulator merging - #39921
Open
sliortega295-ops wants to merge 1 commit into
Open
[Python] Speed up ApproximateUnique accumulator merging#39921sliortega295-ops wants to merge 1 commit into
sliortega295-ops wants to merge 1 commit into
Conversation
Generated-by: OpenAI Codex (GPT-5)
Contributor
|
Assigning reviewers: R: @damccorm for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ApproximateUniqueaccumulator instead of allocating an empty heap and reinserting every sampled hashCHANGES.mdThis brings the Python merge path in line with the existing Java implementation and removes one accumulator's worth of heap insertions from every merge.
Fixes #19459.
Validation
pytest apache_beam/transforms/stats_test.py: 87 passed with the source implementationgit diff --check: passedNo GPU was used or required.
AI disclosure
The implementation, tests, benchmark, and this description were generated with OpenAI Codex at the account owner's request. Codex re-checked the final diff against the repository code and ran the validations listed above. No separate human line-by-line code review was performed before submission.