steveahnahn opened a new pull request, #61656: URL: https://github.com/apache/airflow/pull/61656
## Summary Optimize grid node merge by replacing repeated list scans with a single ID -> node index, improving merge performance when combining node trees. The previous _merge_node_dicts used a set for ID membership (O(1)), but still performed a full list scan to retrieve the node object on every match. That turned the merge into O(n·m) for large grids and repeated work for each incoming node. This change makes lookups O(1) and scales better with newly appended nodes being updated the dict so subsequent lookups see it. ## Tests test_merge_node_dicts_merges_children_and_appends_new_nodes test_merge_node_dicts_preserves_existing_non_group_node_shape test_merge_node_dicts_large_merge_keeps_unique_nodes These cover correct child merges, avoiding accidental mutation of leaf nodes, and ensuring large merges don’t duplicate entries. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
