diff mbox series

[OSSTEST,v2,40/41] cs-bisection-step: Lay out the revision tuple graph once

Message ID 20200731113820.5765-41-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Performance work | expand

Commit Message

Ian Jackson July 31, 2020, 11:38 a.m. UTC
The graph layout algorithm is not very fast, particularly if the
revision graph is big.  In my test case this saves about 10s.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: New patch.
---
 cs-bisection-step | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/cs-bisection-step b/cs-bisection-step
index 027032a1..8544bac0 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -1113,10 +1113,15 @@  END
         or die "$!";
 
     if (eval {
+	print DEBUG "RUNNING dot -Txdot\n";
+	system_checked("dot", "-Txdot", "-o$graphfile.xdot",
+		       "$graphfile.dot");
         foreach my $fmt (qw(ps png svg)) {
-	    print DEBUG "RUNNING dot -T$fmt\n";
-            system_checked("dot", "-T$fmt", "-o$graphfile.$fmt",
-			   "$graphfile.dot");
+	    # neato rather than dot, because neato just uses positions
+	    # etc. in the input whereas dot does (re)calculation work.
+	    print DEBUG "RUNNING neato -n2 -T$fmt\n";
+            system_checked("neato", "-n2", "-T$fmt", "-o$graphfile.$fmt",
+			   "$graphfile.xdot");
         }
 	open SVGI, "$graphfile.svg" or die "$graphfile.svg $!";
 	open SVGO, ">", "$graphfile.svg.new" or die "$graphfile.svg.new $!";