Commit 5bc1c75d authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

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.
parent d98f7038
......@@ -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))
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment