[commit: nofib] master: Support higher timing precision in output parser (5bc1c75)

git at git.haskell.org git at git.haskell.org
Mon Jul 28 08:48:30 UTC 2014


Repository : ssh://git@git.haskell.org/nofib

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5bc1c75db2c74413959772c85d43f8171fdd7b8c/nofib

>---------------------------------------------------------------

commit 5bc1c75db2c74413959772c85d43f8171fdd7b8c
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Mon Jul 28 09:54:41 2014 +0200

    Support higher timing precision in output parser
    
    ...and increase reported precision in nofib-analyse from `%.2f` to `%.3f`
    (i.e. from 10ms to 1ms granularity). See also D97.


>---------------------------------------------------------------

5bc1c75db2c74413959772c85d43f8171fdd7b8c
 nofib-analyse/Main.hs     |  4 ++--
 runstdtest/runstdtest.prl | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/nofib-analyse/Main.hs b/nofib-analyse/Main.hs
index a1340d9..3947091 100644
--- a/nofib-analyse/Main.hs
+++ b/nofib-analyse/Main.hs
@@ -719,7 +719,7 @@ csv_show_results (r:rs) f stat _result_ok norm stddev
           | stddev    = interleave "," (str prog : concat (map stddevbox boxes))
           | otherwise = interleave "," (str prog : map (str.showBox) boxes)
 
-        stddevbox (BoxStdDev b s) = [str (showBox b), str (printf "%.2f" s)]
+        stddevbox (BoxStdDev b s) = [str (showBox b), str (printf "%.3f" s)]
         stddevbox b = [str (showBox b), str "0"]
 
 -- ---------------------------------------------------------------------------
@@ -886,7 +886,7 @@ showBox (Percentage 100) = " 0.0%" -- pattern matching on Float is bad style, bu
 showBox (Percentage f)   = case printf "%.1f%%" (f-100) of
                                xs@('-':_) -> xs
                                xs -> '+':xs
-showBox (BoxFloat f)     = printf "%.2f" f
+showBox (BoxFloat f)     = printf "%.3f" f
 showBox (BoxInt n)       = show n
 showBox (BoxInteger n)   = show n
 --showBox (BoxInt n)       = show (n `div` (1024*1024))
diff --git a/runstdtest/runstdtest.prl b/runstdtest/runstdtest.prl
index 3c2eddc..10a419b 100644
--- a/runstdtest/runstdtest.prl
+++ b/runstdtest/runstdtest.prl
@@ -426,16 +426,16 @@ sub process_stats_file {
 		$TotMem = $1;
 	    }
 
-	    if ( /^\s*INIT\s+time\s*(-*\d+\.\d\d)s\s*\(\s*(-*\d+\.\d\d)s elapsed\)/ ) {
+	    if ( /^\s*INIT\s+time\s*(-*\d+\.\d\d+)s\s*\(\s*(-*\d+\.\d\d+)s elapsed\)/ ) {
 		$InitTime = $1; $InitElapsed = $2;
-	    } elsif ( /^\s*MUT\s+time\s*(-*\d+\.\d\d)s\s*\(\s*(-*\d+\.\d\d)s elapsed\)/ ) {
+	    } elsif ( /^\s*MUT\s+time\s*(-*\d+\.\d\d+)s\s*\(\s*(-*\d+\.\d\d+)s elapsed\)/ ) {
 		$MutTime = $1; $MutElapsed = $2;
-	    } elsif ( /^\s*MUT\+GC0\s+time\s*(-*\d+\.\d\d)s\s*\(\s*(-*\d+\.\d\d)s elapsed\)\s+\(\s*(-*\d+\.\d\d)s\s+MUT\s+\+\s+(-*\d+\.\d\d)s\s+GC0/ ) {
+	    } elsif ( /^\s*MUT\+GC0\s+time\s*(-*\d+\.\d\d+)s\s*\(\s*(-*\d+\.\d\d+)s elapsed\)\s+\(\s*(-*\d+\.\d\d+)s\s+MUT\s+\+\s+(-*\d+\.\d\d+)s\s+GC0/ ) {
 		$MutTime = $3; $MutElapsed = $2;
                 $Gc0Time = $4; $Gc0Elapsed = 0;
-	    } elsif ( /^\s*GC\s+time\s*(-*\d+\.\d\d)s\s*\(\s*(-*\d+\.\d\d)s elapsed\)/ ) {
+	    } elsif ( /^\s*GC\s+time\s*(-*\d+\.\d\d+)s\s*\(\s*(-*\d+\.\d\d+)s elapsed\)/ ) {
 		$GcTime = $1; $GcElapsed = $2;
-	    } elsif ( /^\s*GC1\s+time\s*(-*\d+\.\d\d)s\s*\(\s*(-*\d+\.\d\d)s elapsed\)/ ) {
+	    } elsif ( /^\s*GC1\s+time\s*(-*\d+\.\d\d+)s\s*\(\s*(-*\d+\.\d\d+)s elapsed\)/ ) {
 		$Gc1Time = $1; $Gc1Elapsed = $2;
                 $GcTime = $Gc0Time + $Gc1Time;
 
@@ -445,7 +445,7 @@ sub process_stats_file {
                 $GcElapsed = $Gc1Elapsed;
 	    }
 
-            if (/Generation (\d+):\s*(\d+) collections,\s*\d+ parallel,\s*(-*\d+\.\d\d)s\s*,\s*(-*\d+\.\d\d)s elapsed/) {
+            if (/Generation (\d+):\s*(\d+) collections,\s*\d+ parallel,\s*(-*\d+\.\d\d+)s\s*,\s*(-*\d+\.\d\d+)s elapsed/) {
                 if ($1 == 0) {
                     $GCs += $2 * $procs;
                     $Gc0Count += $2 * $procs;
@@ -525,12 +525,12 @@ sub process_stats_file {
 
 	    $GCs = $1 if /^\s*([0-9]+) GCs?,$/;
 
-	    if ( /^\s*(\d+\.\d\d) \((\d+\.\d)\) seconds total time,$/ ) {
+	    if ( /^\s*(\d+\.\d\d+) \((\d+\.\d)\) seconds total time,$/ ) {
 		$MutTime = $1; $MutElapsed = $2; # will fix up later
 
 		$InitTime = 0; $InitElapsed = 0; # hbc doesn't report these
 
-	    } elsif ( /^\s*(\d+\.\d\d) \((\d+\.\d)\) seconds GC time/ ) {
+	    } elsif ( /^\s*(\d+\.\d\d+) \((\d+\.\d)\) seconds GC time/ ) {
 		$GcTime = $1; $GcElapsed = $2;
 
 		# fix up mutator time now



More information about the ghc-commits mailing list