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() {
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
}
###############################################################################
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
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