From e2e6fd2f424ff7903a56bcabc3484acca83ddf49 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Thu, 7 Dec 2017 17:55:54 +0000 Subject: [PATCH] Improve benchmarks table generator script (#24565) --- test/perf/micro/bin/table.pl | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/test/perf/micro/bin/table.pl b/test/perf/micro/bin/table.pl index dda1394550179..bcb9b1bf94b7a 100755 --- a/test/perf/micro/bin/table.pl +++ b/test/perf/micro/bin/table.pl @@ -12,7 +12,7 @@ our @benchmarks = qw( iteration_pi_sum recursion_fibonacci - recursion_quicksort + recursion_quicksort parse_integers print_to_file matrix_statistics @@ -20,64 +20,64 @@ userfunc_mandelbrot ); -our $c_ver = `gcc -v 2>&1 | grep "gcc version" | cut -f3 -d" "`; -our $julia_ver = `../../../julia -v | cut -f3 -d" "`; -our $fortran_ver = `gfortran -v 2>&1 | grep "gcc version" | cut -f3 -d" "`; -our $python_ver = `python3 -V 2>&1 | cut -f2 -d" "`; -our $matlab_ver = `matlab -nodisplay -nojvm -nosplash -r "version -release, quit" | tail -n 3 | head -n 1`; -our $R_ver = `R --version | grep "R version" | cut -f3 -d" "`; -our $octave_ver = `octave -v | grep version | cut -f4 -d" "`; -our $go_ver = `go version | cut -f3 -d" "`; -#our $lua_ver = `scilua -v 2>&1 | grep Shell | cut -f3 -d" " | cut -f1 -d,`; +our $c_ver = chomp(`gcc -v 2>&1 | grep "gcc version" | cut -f3 -d" "`); +our $julia_ver = chomp(`../../../julia -v | cut -f3 -d" "`); +our $fortran_ver = chomp(`gfortran -v 2>&1 | grep "gcc version" | cut -f3 -d" "`); +our $python_ver = chomp(`python3 -V 2>&1 | cut -f2 -d" "`); +our $matlab_ver = chomp(`matlab -nodisplay -nojvm -nosplash -r "version -release, quit" | tail -n 3 | head -n 1`); +our $R_ver = chomp(`R --version | grep "R version" | cut -f3 -d" "`); +our $octave_ver = chomp(`octave -v | grep version | cut -f4 -d" "`); +our $go_ver = chomp(`go version | cut -f3 -d" "`); +#our $lua_ver = chomp(`scilua -v 2>&1 | grep Shell | cut -f3 -d" " | cut -f1 -d,`); our $lua_ver = "scilua v1.0.0-b12"; # scilua has no run-time versioninfo function -our $javascript_ver = `nodejs -e "console.log(process.versions.v8)"`; -our $mathematica_ver = `echo quit | math -version | head -n 1 | cut -f2 -d" "`; -#our $stata_ver = `stata -q -b version && grep version stata.log | cut -f2 -d" " && rm stata.log`; -our $java_ver = `java -version 2>&1 |grep "version" | cut -f 3 -d " " | cut -c 2-9`; +our $javascript_ver = chomp(`nodejs -e "console.log(process.versions.v8)"`); +our $mathematica_ver = chomp(`echo quit | math -version | head -n 1 | cut -f2 -d" "`); +#our $stata_ver = chomp(`stata -q -b version && grep version stata.log | cut -f2 -d" " && rm stata.log`); +our $java_ver = chomp(`java -version 2>&1 |grep "version" | cut -f3 -d " " | cut -c 2-9`); our %systems = ( - "c" => ["C" , "gcc $c_ver" ], - "julia" => ["Julia" , $julia_ver ], - "lua" => ["LuaJIT" , "$lua_ver" ], - "fortran" => ["Fortran" , "gcc $fortran_ver" ], - "java" => ["Java" , $java_ver ], - "javascript" => ["JavaScript" , "V8 $javascript_ver" ], - "matlab" => ["Matlab" , "R$matlab_ver" ], - "python" => ["Python" , $python_ver ], - "mathematica"=> ["Mathe-matica" , $mathematica_ver ], - "r" => ["R" , $R_ver ], - "octave" => ["Octave" , $octave_ver ], - "go" => ["Go" , $go_ver ], -# "stata" => ["Stata" , $stata_ver ], + "c" => ["C" , "gcc $c_ver" ], + "julia" => ["Julia" , $julia_ver ], + "lua" => ["LuaJIT" , "$lua_ver" ], + "fortran" => ["Fortran" , "gcc $fortran_ver" ], + "java" => ["Java" , $java_ver ], + "javascript" => ["JavaScript" , "V8 $javascript_ver" ], + "matlab" => ["Matlab" , "R$matlab_ver" ], + "python" => ["Python" , $python_ver ], + "mathematica"=> ["Mathe­matica" , $mathematica_ver ], + "r" => ["R" , $R_ver ], + "octave" => ["Octave" , $octave_ver ], + "go" => ["Go" , $go_ver ], +# "stata" => ["Stata" , $stata_ver ], ); our @systems = qw(c julia lua fortran go java javascript mathematica python matlab r octave); -#our @systems = qw(lua); +print qq[\n]; print qq[\n]; -print qq[\n]; -print qq[\n]; -printf qq[\n], scalar(@systems); -print qq[\n]; -print qq[\n]; -print qq[]; -print qq[]; -print qq[] for @systems; -print qq[\n]; -print qq[]; -print qq[]; -print qq[] for @systems; -print qq[\n]; -print qq[\n]; -print qq[\n]; +print qq[\t\n]; +print qq[\t\t\n]; +printf qq[\t\t\n], scalar(@systems); +print qq[\t\n]; +print qq[\t\n]; +print qq[\t\t\n]; +print qq[\t\t\t\n]; +print qq[\t\t\t\n] for @systems; +print qq[\t\t\n]; +print qq[\t\t\n]; +print qq[\t\t\t\n]; +print qq[\t\t\t\n] for @systems; +print qq[\t\t\n]; +print qq[\t\n]; +print qq[\t\n]; for my $benchmark (@benchmarks) { - print qq[]; - print qq[]; + print qq[\t\t\n]; + print qq[\t\t\t\n]; for my $system (@systems) { - printf qq[], $_{$benchmark}{$system}/$_{$benchmark}{'c'}; + printf qq[\t\t\t\n], $_{$benchmark}{$system}/$_{$benchmark}{'c'}; } - print qq[\n]; + print qq[\t\t\n]; } -print qq[\n]; +print qq[\t\n]; print qq[
$systems{$_}[0]
$systems{$_}[1]
$systems{$_}[0]
$systems{$_}[1]
$benchmark
$benchmark%.2f%.2f
\n];