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