X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=demos%2Fperformance%2Ftest-performance.sh;h=89a8b3e37088e0574db3ac97d96699dc59e34ba4;hb=06ab91f038972610338e77f4f488c7ef5c132e69;hp=cadcbfd1090bbd372f64dfce284479449ce3cb70;hpb=67db9ef19d8b36eb84357b6e6477b7791b59182f;p=svn%2FCll1h%2F.git diff --git a/demos/performance/test-performance.sh b/demos/performance/test-performance.sh index cadcbfd..89a8b3e 100755 --- a/demos/performance/test-performance.sh +++ b/demos/performance/test-performance.sh @@ -1,60 +1,118 @@ -#!/bin/sh +#!/bin/bash +echo "------------------------------------------------------------- Ruby" cat print.rb echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./print.rb > /dev/null -echo +time ./print.rb > /dev/null +echo "--------------------------------------------------- Python - range" cat print.py echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./print.py > /dev/null -echo +time ./print.py > /dev/null +echo "-------------------------------------------------- Python - xrange" cat xrange.py echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./xrange.py > /dev/null -echo +time ./xrange.py > /dev/null +echo "------------------------------------------------------------ PHP 5" cat echo.php echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./echo.php > /dev/null -echo +time ./echo.php > /dev/null +echo "-------------------------------------------------- C - gcc - write" cat write.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 write.c -o write +time gcc -O2 write.c -o write echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./write > /dev/null +time ./write > /dev/null +echo "------------------------------------------------------------- Perl" cat print.pl echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./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, %O outputs" g++ -O2 cout.cpp -o cout +time g++ -O2 cout.cpp -o cout echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./cout > /dev/null +time ./cout > /dev/null -echo -cat cll1-print.c +#echo "----------------------------------------------- C<<1 - tcc - print" +#cat cll1-print.c +#echo -n "Compiling..." +#time tcc -O2 cll1-print.c -o cll1-print +#echo -n "Running..." +#time ./cll1-print > /dev/null +# +#echo "------------------------------------------------- C - tcc - printf" +#cat printf.c +#echo -n "Compiling..." +#time tcc -O2 printf.c -o printf +#echo -n "Running..." +#time ./printf > /dev/null +# +#echo "--------------------------------------------------- C - tcc - puts" +#cat puts.c +#echo -n "Compiling..." +#time tcc -O2 puts.c -o puts +#echo -n "Running..." +#time ./puts > /dev/null +# +#echo "-------------------------------------------------- C - tcc - fputs" +#cat fputs.c +#echo -n "Compiling..." +#time tcc -O2 fputs.c -o fputs +#echo -n "Running..." +#time ./fputs > /dev/null +# +#echo "------------------------------------------------- C - tcc - fwrite" +#cat fwrite.c +#echo -n "Compiling..." +#time tcc -O2 fwrite.c -o fwrite +#echo -n "Running..." +#time ./fwrite > /dev/null +# + +echo "-----------------------------------------------= C<<1 - gcc - echo" +cat cll1-echo.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 cll1-print.c -o cll1-print +time gcc -O2 cll1-echo.c -o cll1-echo echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./cll1-print > /dev/null -echo +time ./cll1-echo > /dev/null +echo "------------------------------------------------- C - gcc - printf" cat printf.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 printf.c -o printf +time gcc -O2 printf.c -o printf echo -n "Running..." -time -f "%E total, %U user, %S sys, %O outputs" ./printf > /dev/null -echo +time ./printf > /dev/null +echo "--------------------------------------------------- C - gcc - puts" cat puts.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 puts.c -o puts +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 gcc -O2 fwrite.c -o fwrite +echo -n "Running..." +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 -f "%E total, %U user, %S sys, %O outputs" ./puts > /dev/null -echo +time ./fputs > /dev/null