mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
perf(dashboard): skip diff overlay computation when diffMode is off
Guard diffNodeIds construction and per-edge lookups behind diffMode check to avoid unnecessary Set spreads and has() calls on every graph recompute when diff mode is inactive. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
da8509e2b1
commit
4161d3eba3
@@ -89,10 +89,10 @@ export default function GraphView() {
|
||||
};
|
||||
});
|
||||
|
||||
const diffNodeIds = new Set([...changedNodeIds, ...affectedNodeIds]);
|
||||
const diffNodeIds = diffMode ? new Set([...changedNodeIds, ...affectedNodeIds]) : new Set<string>();
|
||||
const flowEdges: Edge[] = filteredGraphEdges.map((edge, i) => {
|
||||
const sourceInDiff = diffNodeIds.has(edge.source);
|
||||
const targetInDiff = diffNodeIds.has(edge.target);
|
||||
const sourceInDiff = diffMode && diffNodeIds.has(edge.source);
|
||||
const targetInDiff = diffMode && diffNodeIds.has(edge.target);
|
||||
const isImpacted = diffMode && (sourceInDiff || targetInDiff);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user