]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Improve perf.sh output
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 28 Apr 2010 18:45:03 +0000 (20:45 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 28 Apr 2010 18:45:03 +0000 (20:45 +0200)
perf.sh

diff --git a/perf.sh b/perf.sh
index a1d4b8901ad9b3d21b98e5ceae947805182a2e64..9b655cd01a67a18e4725ff353263e8b2c95fbd8d 100755 (executable)
--- a/perf.sh
+++ b/perf.sh
@@ -31,10 +31,11 @@ compile() {
     rm -rf $objdir
     mkdir -p $objdir
     while [ $i -lt $n ]; do
-        echo "  $compiler -c -O2 $i.cc -o $objdir/$i.o"
+        echo -n .
         $compiler -c $i.cc -O2 -o $objdir/$i.o
         i=$(($i + 1))
     done
+    echo
 }
 
 now() {
@@ -51,7 +52,7 @@ stat() {
     ref_time=$3
     perc=$(perl -e "print 100 * $time / $ref_time")
     factor=$(perl -e "print $ref_time / $time")
-    printf "%-36s %.3f s (%6.2f %%) (%5.2f x)\n" "$desc:" $time $perc $factor
+    printf "%-36s %5.2f s (%6.2f %%) (%5.2f x)\n" "$desc:" $time $perc $factor
 }
 
 ###############################################################################
@@ -84,19 +85,16 @@ echo "Without ccache:"
 t0=$(now)
 compile $n $cxx
 t_wo=$(elapsed $t0)
-echo "Time: $t_wo"
 
 echo "With ccache, no direct, cache miss:"
 t0=$(now)
 compile $n "$ccache $cxx"
 t_p_m=$(elapsed $t0)
-echo "Time: $t_p_m"
 
 echo "With ccache, no direct, cache hit:"
 t0=$(now)
 compile $n "$ccache $cxx"
 t_p_h=$(elapsed $t0)
-echo "Time: $t_p_h"
 
 unset CCACHE_NODIRECT
 rm -rf $CCACHE_DIR
@@ -105,13 +103,11 @@ echo "With ccache, direct, cache miss:"
 t0=$(now)
 compile $n "$ccache $cxx"
 t_d_m=$(elapsed $t0)
-echo "Time: $t_d_m"
 
 echo "With ccache, direct, cache hit:"
 t0=$(now)
 compile $n "$ccache $cxx"
 t_d_h=$(elapsed $t0)
-echo "Time: $t_d_h"
 
 echo
 stat "Without ccache" $t_wo $t_wo