comparison: When marking leaf nodes don't do unnecessary impact analysis
authorDodji Seketeli <dodji@redhat.com>
Thu, 16 Feb 2023 11:33:02 +0000 (12:33 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 2 Mar 2023 17:31:43 +0000 (18:31 +0100)
When marking leaf nodes, if interface impact analysis is not required,
then avoid visiting the same diff node twice when walking the diff
graph.  Allowing to visit the same diff node twice would be useful so
that the sub-graph of each interface diff node would be walked in full
to determine the impact of each leaf diff node on each interface.  But
if such impact analysis is not required, then we can just visit each
diff graph node once and speed up things greatly in leaf node
reporting mode.

* src/abg-comparison.cc (corpus_diff::mark_leaf_diff_nodes): If
impact analysis is not required, visit each node just once.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-comparison.cc

index 886e48fdf9e8bf4e343448472e7ed4db525d3b15..1533d9d109012b75dd10a5ebfdf5db6341fdfed6 100644 (file)
@@ -11230,7 +11230,8 @@ corpus_diff::mark_leaf_diff_nodes()
   context()->forget_visited_diffs();
   bool s = context()->visiting_a_node_twice_is_forbidden();
   context()->forbid_visiting_a_node_twice(true);
-  context()->forbid_visiting_a_node_twice_per_interface(true);
+  if (context()->show_impacted_interfaces())
+    context()->forbid_visiting_a_node_twice_per_interface(true);
   traverse(v);
   context()->forbid_visiting_a_node_twice(s);
   context()->forbid_visiting_a_node_twice_per_interface(false);