| 1 | #!/bin/bash |
| 2 | 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 |
| 3 | |
| 4 | if [ "$1" == "all" ] |
| 5 | then |
| 6 | echo "------------------------------------------------------------- Ruby" |
| 7 | cat print.rb |
| 8 | echo -n "Running..." |
| 9 | time ./print.rb > /dev/null |
| 10 | |
| 11 | echo "--------------------------------------------------- Python - range" |
| 12 | cat print.py |
| 13 | echo -n "Running..." |
| 14 | time ./print.py > /dev/null |
| 15 | |
| 16 | echo "-------------------------------------------------- Python - xrange" |
| 17 | cat xrange.py |
| 18 | echo -n "Running..." |
| 19 | time ./xrange.py > /dev/null |
| 20 | |
| 21 | echo "------------------------------------------------------------ PHP 5" |
| 22 | cat echo.php |
| 23 | echo -n "Running..." |
| 24 | time ./echo.php > /dev/null |
| 25 | fi |
| 26 | |
| 27 | echo "-------------------------------------------------- C - gcc - write" |
| 28 | cat write.c |
| 29 | echo -n "Compiling..." |
| 30 | time gcc -O2 write.c -o write |
| 31 | echo -n "Running..." |
| 32 | time ./write > /dev/null |
| 33 | |
| 34 | echo "------------------------------------------------------------- Perl" |
| 35 | cat print.pl |
| 36 | echo -n "Running..." |
| 37 | time ./print.pl > /dev/null |
| 38 | |
| 39 | echo "----------------------------------------------- C<<1 - gcc - print" |
| 40 | cat cll1-print.c |
| 41 | echo -n "Compiling..." |
| 42 | time gcc -O2 cll1-print.c -o cll1-print |
| 43 | echo -n "Running..." |
| 44 | time ./cll1-print > /dev/null |
| 45 | |
| 46 | echo "---------------------------------------------- C - g++ - std::cout" |
| 47 | cat cout.cpp |
| 48 | echo -n "Compiling..." |
| 49 | time g++ -O2 cout.cpp -o cout |
| 50 | echo -n "Running..." |
| 51 | time ./cout > /dev/null |
| 52 | |
| 53 | echo "----------------------------------------------- C<<1 - tcc - print" |
| 54 | cat cll1-print.c |
| 55 | echo -n "Compiling..." |
| 56 | time tcc cll1-print.c -o cll1-print |
| 57 | echo -n "Running..." |
| 58 | time ./cll1-print > /dev/null |
| 59 | |
| 60 | echo "------------------------------------------------- C - tcc - printf" |
| 61 | cat printf.c |
| 62 | echo -n "Compiling..." |
| 63 | time tcc printf.c -o printf |
| 64 | echo -n "Running..." |
| 65 | time ./printf > /dev/null |
| 66 | |
| 67 | echo "------------------------------------------------ C<<1 - tcc - echo" |
| 68 | cat cll1-echo.c |
| 69 | echo -n "Compiling..." |
| 70 | time tcc cll1-echo.c -o cll1-echo |
| 71 | echo -n "Running..." |
| 72 | time ./cll1-echo > /dev/null |
| 73 | |
| 74 | echo "--------------------------------------------------- C - tcc - puts" |
| 75 | cat puts.c |
| 76 | echo -n "Compiling..." |
| 77 | time tcc puts.c -o puts |
| 78 | echo -n "Running..." |
| 79 | time ./puts > /dev/null |
| 80 | |
| 81 | echo "------------------------------------------------- C - tcc - fwrite" |
| 82 | cat fwrite.c |
| 83 | echo -n "Compiling..." |
| 84 | time tcc fwrite.c -o fwrite |
| 85 | echo -n "Running..." |
| 86 | time ./fwrite > /dev/null |
| 87 | |
| 88 | echo "-------------------------------------------------- C - tcc - fputs" |
| 89 | cat fputs.c |
| 90 | echo -n "Compiling..." |
| 91 | time tcc fputs.c -o fputs |
| 92 | echo -n "Running..." |
| 93 | time ./fputs > /dev/null |
| 94 | |
| 95 | echo "------------------------------------------------ C<<1 - gcc - echo" |
| 96 | cat cll1-echo.c |
| 97 | echo -n "Compiling..." |
| 98 | time gcc -O2 cll1-echo.c -o cll1-echo |
| 99 | echo -n "Running..." |
| 100 | time ./cll1-echo > /dev/null |
| 101 | |
| 102 | echo "------------------------------------------------- C - gcc - printf" |
| 103 | cat printf.c |
| 104 | echo -n "Compiling..." |
| 105 | time gcc -O2 printf.c -o printf |
| 106 | echo -n "Running..." |
| 107 | time ./printf > /dev/null |
| 108 | |
| 109 | echo "--------------------------------------------------- C - gcc - puts" |
| 110 | cat puts.c |
| 111 | echo -n "Compiling..." |
| 112 | time gcc -O2 puts.c -o puts |
| 113 | echo -n "Running..." |
| 114 | time ./puts > /dev/null |
| 115 | |
| 116 | echo "------------------------------------------------- C - gcc - fwrite" |
| 117 | cat fwrite.c |
| 118 | echo -n "Compiling..." |
| 119 | time gcc -O2 fwrite.c -o fwrite |
| 120 | echo -n "Running..." |
| 121 | time ./fwrite > /dev/null |
| 122 | |
| 123 | echo "-------------------------------------------------- C - gcc - fputs" |
| 124 | cat fputs.c |
| 125 | echo -n "Compiling..." |
| 126 | time gcc -O2 fputs.c -o fputs |
| 127 | echo -n "Running..." |
| 128 | time ./fputs > /dev/null |
| 129 | |