-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚡️ Speed up method
PerPartitionCursor.set_initial_state
by 8% in PR #…
…45122 (`artem1205/airbyte-cdk-state-mgiration`) Here is a more optimized version of the given Python program to improve runtime efficiency by minimizing redundant computations and reducing the complexity of operations. ### Key Optimizations. 1. **Re-assigned state_dict to avoid multiple dictionary access:** `stream_state.get("states")` 2. **Used set comprehension** enhances readability and avoids multiple calls. 3. **Combined dictionary updates directly** to use a single pass to populate `_cursor_per_partition`.
- Loading branch information
1 parent
2b5c531
commit 67b2f21
Showing
2 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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