pierrejeambrun commented on code in PR #64271:
URL: https://github.com/apache/airflow/pull/64271#discussion_r3116552110


##########
airflow-core/src/airflow/ui/src/context/groups/GroupsProvider.tsx:
##########
@@ -57,21 +54,17 @@ export const OpenGroupsProvider = ({ children, dagId }: 
Props) => {
     { enabled: Boolean(dagId) && selectedVersion !== undefined },
   );
 
-  // Update allGroupIds whenever structure changes
-  useEffect(() => {
-    const observedGroupIds = flattenGraphNodes(structure.nodes).allGroupIds;
+  const { allGroupIds: observedGroupIds, allOperators } = 
flattenGraphNodes(structure.nodes);

Review Comment:
   `flattenGraphNodes(structure.nodes)` runs on every render of the provider, 
which is a full tree walk. Wrap in `useMemo` keyed on `structure.nodes`.



-- 
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]

Reply via email to