X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=demos%2Fperformance%2Ftest-performance.sh;h=45cc4e0255b2725b3436ed6e7754eb3d10162705;hb=6a60bc82e8b8e6cccd0d4c2214a1f291662215f0;hp=9c76b3f0c95e60f2671e33042b5118dc48e0ceea;hpb=e1fbb836e8f710979f270ba8fdbc92a8e65f7348;p=svn%2FCll1h%2F.git diff --git a/demos/performance/test-performance.sh b/demos/performance/test-performance.sh index 9c76b3f..45cc4e0 100755 --- a/demos/performance/test-performance.sh +++ b/demos/performance/test-performance.sh @@ -1,73 +1,129 @@ -#!/bin/sh +#!/bin/bash +echo `grep "model name" /proc/cpuinfo |cut -f 2 -d :` `grep "cpu MHz" /proc/cpuinfo |cut -f 2 -d :` Mhz ` grep "bogomips" /proc/cpuinfo |cut -f 2 -d :` bogomips -cat print.rb -echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./print.rb > /dev/null -echo +if [ "$1" == "all" ] +then + echo "------------------------------------------------------------- Ruby" + cat print.rb + echo -n "Running..." + time ./print.rb > /dev/null -cat print.py -echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./print.py > /dev/null -echo + echo "--------------------------------------------------- Python - range" + cat print.py + echo -n "Running..." + time ./print.py > /dev/null -cat xrange.py -echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./xrange.py > /dev/null -echo + echo "-------------------------------------------------- Python - xrange" + cat xrange.py + echo -n "Running..." + time ./xrange.py > /dev/null -cat echo.php -echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./echo.php > /dev/null -echo + echo "------------------------------------------------------------ PHP 5" + cat echo.php + echo -n "Running..." + time ./echo.php > /dev/null +fi +echo "-------------------------------------------------- C - gcc - write" cat write.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 write.c -o write +time gcc -O2 write.c -o write echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./write > /dev/null +time ./write > /dev/null +echo "------------------------------------------------------------- Perl" cat print.pl echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./print.pl > /dev/null -echo +time ./print.pl > /dev/null + +echo "----------------------------------------------- C<<1 - gcc - print" +cat cll1-print.c +echo -n "Compiling..." +time gcc -O2 cll1-print.c -o cll1-print +echo -n "Running..." +time ./cll1-print > /dev/null +echo "---------------------------------------------- C - g++ - std::cout" cat cout.cpp echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" g++ -O2 cout.cpp -o cout +time g++ -O2 cout.cpp -o cout echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./cout > /dev/null +time ./cout > /dev/null -echo +echo "----------------------------------------------- C<<1 - tcc - print" cat cll1-print.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 cll1-print.c -o cll1-print +time tcc cll1-print.c -o cll1-print echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./cll1-print > /dev/null -echo +time ./cll1-print > /dev/null +echo "------------------------------------------------- C - tcc - printf" cat printf.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 printf.c -o printf +time tcc printf.c -o printf echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./printf > /dev/null -echo +time ./printf > /dev/null +echo "------------------------------------------------ C<<1 - tcc - echo" +cat cll1-echo.c +echo -n "Compiling..." +time tcc cll1-echo.c -o cll1-echo +echo -n "Running..." +time ./cll1-echo > /dev/null + +echo "--------------------------------------------------- C - tcc - puts" cat puts.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 puts.c -o puts +time tcc puts.c -o puts +echo -n "Running..." +time ./puts > /dev/null + +echo "------------------------------------------------- C - tcc - fwrite" +cat fwrite.c +echo -n "Compiling..." +time tcc fwrite.c -o fwrite echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./puts > /dev/null -echo +time ./fwrite > /dev/null +echo "-------------------------------------------------- C - tcc - fputs" cat fputs.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 fputs.c -o fputs +time tcc fputs.c -o fputs echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./fputs > /dev/null -echo +time ./fputs > /dev/null +echo "------------------------------------------------ C<<1 - gcc - echo" +cat cll1-echo.c +echo -n "Compiling..." +time gcc -O2 cll1-echo.c -o cll1-echo +echo -n "Running..." +time ./cll1-echo > /dev/null + +echo "------------------------------------------------- C - gcc - printf" +cat printf.c +echo -n "Compiling..." +time gcc -O2 printf.c -o printf +echo -n "Running..." +time ./printf > /dev/null + +echo "--------------------------------------------------- C - gcc - puts" +cat puts.c +echo -n "Compiling..." +time gcc -O2 puts.c -o puts +echo -n "Running..." +time ./puts > /dev/null + +echo "------------------------------------------------- C - gcc - fwrite" cat fwrite.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %F page faults" gcc -O2 fwrite.c -o fwrite +time gcc -O2 fwrite.c -o fwrite echo -n "Running..." -time -f "%E total, %U user, %S sys, %F page faults" ./fwrite > /dev/null +time ./fwrite > /dev/null + +echo "-------------------------------------------------- C - gcc - fputs" +cat fputs.c +echo -n "Compiling..." +time gcc -O2 fputs.c -o fputs +echo -n "Running..." +time ./fputs > /dev/null +