Repository navigation
Conversation
Contributor
|
Assigning reviewers: R: @claudevdm for label python. This pull request likely touches a core component ("core" label). Please review with scrutiny. 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). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40501 +/- ##
============================================
+ Coverage 56.16% 56.23% +0.06%
Complexity 2288 2288
============================================
Files 1124 1124
Lines 178336 178366 +30
Branches 1489 1489
============================================
+ Hits 100170 100303 +133
+ Misses 75645 75542 -103
Partials 2521 2521
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Fixes #20226
This PR reduces runtime type-checking overhead in the Python SDK by consolidating two nested
DoFnwrappers into a singleRuntimeTypeCheckWrapperDoFn.Previously, input and output checks were handled by separate wrappers. The merged wrapper aims to preserve existing type-checking behavior while eliminating one level of Python call indirection per processed element.
Changes
OutputCheckWrapperDoFnandTypeCheckWrapperDoFnintoRuntimeTypeCheckWrapperDoFn.processfunction while avoiding storing a bound method on the wrapper, preserving statefulDoFnvalidation.DoFncompatibility.Tests
apache_beam/typehints/typecheck_test.py: 18 passed.apache_beam/transforms/ptransform_test.py: 202 passed, 4 skipped.Performance
Compared the original and modified implementations using Beam's existing
runtime_type_check_microbenchmark.Configuration: 20
DoFns and three timing repetitions per configuration.At 2,001 elements, the measured runtime was approximately 4.5% lower for simple type hints and 5.2% lower for nested type hints in this local run.
These measurements are preliminary and may vary by environment. They demonstrate the results of this benchmark configuration, not a guaranteed improvement for all pipelines.