45cf8709 |
1 | AMD Athlon(tm) XP 1259.392 Mhz 2520.58 bogomips |
2 | ------------------------------------------------------------- Ruby |
3 | #!/usr/bin/ruby |
4 | |
5 | 10000000.times { print "stuff","\n" } |
6 | |
7 | Running... |
c71d5ab7 |
8 | real 0m31.160s |
9 | user 0m29.546s |
10 | sys 0m1.548s |
45cf8709 |
11 | --------------------------------------------------- Python - range |
12 | #!/usr/bin/python |
13 | |
14 | for i in range(1,10000000): |
15 | print "stuff" |
16 | |
17 | Running... |
c71d5ab7 |
18 | real 0m18.386s |
19 | user 0m17.757s |
20 | sys 0m0.308s |
45cf8709 |
21 | -------------------------------------------------- Python - xrange |
22 | #!/usr/bin/python |
23 | |
24 | for i in xrange(1,10000000): |
25 | print "stuff" |
26 | |
27 | Running... |
c71d5ab7 |
28 | real 0m18.832s |
29 | user 0m18.805s |
30 | sys 0m0.024s |
45cf8709 |
31 | ------------------------------------------------------------ PHP 5 |
32 | #!/usr/bin/php5 -q |
33 | <?php |
34 | for ( $i=0; $i<10000000; $i++ ) |
35 | { |
36 | echo "stuff1\n"; |
37 | } |
38 | ?> |
39 | Running... |
c71d5ab7 |
40 | real 0m10.832s |
41 | user 0m7.696s |
42 | sys 0m2.544s |
06ab91f0 |
43 | -------------------------------------------------- C - gcc - write |
67db9ef1 |
44 | #include <string.h> |
45 | |
46 | #define RUNS 10000000UL |
47 | int main (void) |
48 | { |
49 | unsigned long i; |
50 | char *s1="stuff\n"; |
51 | int l1=strlen(s1); |
52 | |
06ab91f0 |
53 | for (i=0;i<RUNS;i++) |
54 | { |
55 | write(1,s1,l1); |
56 | } |
57 | return 0; |
67db9ef1 |
58 | } |
06ab91f0 |
59 | Compiling... |
c71d5ab7 |
60 | real 0m0.911s |
61 | user 0m0.148s |
62 | sys 0m0.036s |
06ab91f0 |
63 | Running... |
c71d5ab7 |
64 | real 0m5.809s |
65 | user 0m2.164s |
66 | sys 0m3.648s |
06ab91f0 |
67 | ------------------------------------------------------------- Perl |
ba41861f |
68 | #!/usr/bin/perl |
69 | |
70 | my $i=0; |
71 | for ($i=0;$i<10000000;$i++) |
72 | { |
45cf8709 |
73 | print ("stuff\n"); |
ba41861f |
74 | } |
75 | |
06ab91f0 |
76 | Running... |
c71d5ab7 |
77 | real 0m7.095s |
78 | user 0m6.836s |
79 | sys 0m0.004s |
06ab91f0 |
80 | ----------------------------------------------- C<<1 - gcc - print |
81 | #include "cll1.h" |
283bc497 |
82 | |
06ab91f0 |
83 | program |
84 | { |
85 | repeat(10000000) |
86 | print("stuff"); |
87 | } |
88 | Compiling... |
c71d5ab7 |
89 | real 0m0.521s |
90 | user 0m0.304s |
91 | sys 0m0.068s |
06ab91f0 |
92 | Running... |
c71d5ab7 |
93 | real 0m2.108s |
94 | user 0m2.104s |
95 | sys 0m0.004s |
06ab91f0 |
96 | ---------------------------------------------- C - g++ - std::cout |
d8394559 |
97 | #include <iostream> |
98 | |
99 | #define RUNS 10000000UL |
100 | int main() |
101 | { |
102 | unsigned long i; |
06ab91f0 |
103 | for (i=0;i<RUNS;i++) |
104 | { |
105 | std::cout << "stuff\n"; |
d8394559 |
106 | } |
107 | return 0; |
108 | } |
06ab91f0 |
109 | Compiling... |
c71d5ab7 |
110 | real 0m1.917s |
111 | user 0m0.896s |
112 | sys 0m0.084s |
06ab91f0 |
113 | Running... |
c71d5ab7 |
114 | real 0m1.694s |
115 | user 0m1.680s |
a30ccb5a |
116 | sys 0m0.016s |
2814fb59 |
117 | ----------------------------------------------- C<<1 - tcc - print |
118 | #include "cll1.h" |
119 | |
120 | program |
121 | { |
122 | repeat(10000000) |
123 | print("stuff"); |
124 | } |
45cf8709 |
125 | Compiling... |
c71d5ab7 |
126 | real 0m0.125s |
127 | user 0m0.016s |
45cf8709 |
128 | sys 0m0.008s |
2814fb59 |
129 | Running... |
c71d5ab7 |
130 | real 0m2.884s |
131 | user 0m2.884s |
132 | sys 0m0.000s |
2814fb59 |
133 | ------------------------------------------------- C - tcc - printf |
134 | #include <stdio.h> |
135 | |
136 | #define RUNS 10000000UL |
137 | int main (void) |
138 | { |
139 | unsigned long i; |
140 | for (i=0;i<RUNS;i++) |
141 | { |
142 | printf("stuff\n"); |
143 | } |
144 | return 0; |
145 | } |
45cf8709 |
146 | Compiling... |
c71d5ab7 |
147 | real 0m0.011s |
148 | user 0m0.004s |
149 | sys 0m0.004s |
2814fb59 |
150 | Running... |
c71d5ab7 |
151 | real 0m1.734s |
152 | user 0m1.732s |
45cf8709 |
153 | sys 0m0.004s |
2814fb59 |
154 | ------------------------------------------------ C<<1 - tcc - echo |
81088cec |
155 | #include "cll1.h" |
156 | |
157 | program |
158 | { |
06ab91f0 |
159 | unsigned long i; |
160 | for_range(i,1,10000000) |
161 | echo("stuff\n"); |
81088cec |
162 | } |
45cf8709 |
163 | Compiling... |
c71d5ab7 |
164 | real 0m0.021s |
165 | user 0m0.016s |
45cf8709 |
166 | sys 0m0.004s |
2814fb59 |
167 | Running... |
c71d5ab7 |
168 | real 0m1.365s |
169 | user 0m1.360s |
170 | sys 0m0.004s |
2814fb59 |
171 | --------------------------------------------------- C - tcc - puts |
172 | #include <stdio.h> |
173 | |
174 | #define RUNS 10000000UL |
175 | int main (void) |
176 | { |
177 | unsigned long i; |
178 | for (i=0;i<RUNS;i++) |
179 | { |
180 | puts("stuff"); |
181 | } |
182 | return 0; |
183 | } |
45cf8709 |
184 | Compiling... |
c71d5ab7 |
185 | real 0m0.016s |
186 | user 0m0.012s |
187 | sys 0m0.000s |
45cf8709 |
188 | Running... |
c71d5ab7 |
189 | real 0m1.115s |
190 | user 0m1.108s |
191 | sys 0m0.008s |
2814fb59 |
192 | ------------------------------------------------- C - tcc - fwrite |
193 | #include <stdio.h> |
194 | #include <string.h> |
195 | |
196 | #define RUNS 10000000UL |
197 | int main (void) |
198 | { |
199 | unsigned long i; |
200 | char *s1="stuff\n"; |
201 | int l1=strlen(s1); |
202 | |
203 | for (i=0;i<RUNS;i++) |
204 | { |
205 | fwrite(s1,l1,1,stdout); |
206 | } |
207 | return 0; |
208 | } |
45cf8709 |
209 | Compiling... |
c71d5ab7 |
210 | real 0m0.029s |
211 | user 0m0.004s |
212 | sys 0m0.008s |
45cf8709 |
213 | Running... |
c71d5ab7 |
214 | real 0m1.025s |
215 | user 0m1.020s |
216 | sys 0m0.004s |
2814fb59 |
217 | -------------------------------------------------- C - tcc - fputs |
218 | #include <stdio.h> |
219 | |
220 | #define RUNS 10000000UL |
221 | int main (void) |
222 | { |
223 | unsigned long i; |
224 | for (i=0;i<RUNS;i++) |
225 | { |
226 | fputs("stuff\n",stdout); |
227 | } |
228 | return 0; |
229 | } |
45cf8709 |
230 | Compiling... |
c71d5ab7 |
231 | real 0m0.012s |
232 | user 0m0.004s |
233 | sys 0m0.008s |
2814fb59 |
234 | Running... |
c71d5ab7 |
235 | real 0m1.104s |
236 | user 0m1.092s |
237 | sys 0m0.012s |
2814fb59 |
238 | ------------------------------------------------ C<<1 - gcc - echo |
239 | #include "cll1.h" |
240 | |
241 | program |
242 | { |
243 | unsigned long i; |
244 | for_range(i,1,10000000) |
245 | echo("stuff\n"); |
246 | } |
247 | Compiling... |
c71d5ab7 |
248 | real 0m0.362s |
249 | user 0m0.320s |
45cf8709 |
250 | sys 0m0.040s |
2814fb59 |
251 | Running... |
c71d5ab7 |
252 | real 0m1.230s |
253 | user 0m1.228s |
254 | sys 0m0.004s |
06ab91f0 |
255 | ------------------------------------------------- C - gcc - printf |
81088cec |
256 | #include <stdio.h> |
257 | |
258 | #define RUNS 10000000UL |
259 | int main (void) |
260 | { |
06ab91f0 |
261 | unsigned long i; |
262 | for (i=0;i<RUNS;i++) |
263 | { |
264 | printf("stuff\n"); |
265 | } |
266 | return 0; |
81088cec |
267 | } |
06ab91f0 |
268 | Compiling... |
c71d5ab7 |
269 | real 0m0.184s |
270 | user 0m0.148s |
271 | sys 0m0.036s |
06ab91f0 |
272 | Running... |
c71d5ab7 |
273 | real 0m1.072s |
274 | user 0m1.060s |
275 | sys 0m0.012s |
06ab91f0 |
276 | --------------------------------------------------- C - gcc - puts |
e1fbb836 |
277 | #include <stdio.h> |
278 | |
279 | #define RUNS 10000000UL |
280 | int main (void) |
281 | { |
06ab91f0 |
282 | unsigned long i; |
283 | for (i=0;i<RUNS;i++) |
284 | { |
285 | puts("stuff"); |
286 | } |
287 | return 0; |
e1fbb836 |
288 | } |
06ab91f0 |
289 | Compiling... |
c71d5ab7 |
290 | real 0m0.182s |
291 | user 0m0.152s |
292 | sys 0m0.032s |
a30ccb5a |
293 | Running... |
c71d5ab7 |
294 | real 0m1.075s |
295 | user 0m1.072s |
296 | sys 0m0.000s |
06ab91f0 |
297 | ------------------------------------------------- C - gcc - fwrite |
e1fbb836 |
298 | #include <stdio.h> |
299 | #include <string.h> |
300 | |
301 | #define RUNS 10000000UL |
302 | int main (void) |
303 | { |
304 | unsigned long i; |
305 | char *s1="stuff\n"; |
306 | int l1=strlen(s1); |
307 | |
308 | for (i=0;i<RUNS;i++) |
309 | { |
310 | fwrite(s1,l1,1,stdout); |
311 | } |
312 | return 0; |
313 | } |
06ab91f0 |
314 | Compiling... |
c71d5ab7 |
315 | real 0m0.197s |
316 | user 0m0.164s |
317 | sys 0m0.032s |
06ab91f0 |
318 | Running... |
c71d5ab7 |
319 | real 0m0.968s |
320 | user 0m0.956s |
321 | sys 0m0.012s |
06ab91f0 |
322 | -------------------------------------------------- C - gcc - fputs |
323 | #include <stdio.h> |
324 | |
325 | #define RUNS 10000000UL |
326 | int main (void) |
327 | { |
328 | unsigned long i; |
329 | for (i=0;i<RUNS;i++) |
330 | { |
331 | fputs("stuff\n",stdout); |
332 | } |
333 | return 0; |
334 | } |
335 | Compiling... |
c71d5ab7 |
336 | real 0m0.183s |
337 | user 0m0.156s |
338 | sys 0m0.028s |
06ab91f0 |
339 | Running... |
c71d5ab7 |
340 | real 0m0.970s |
341 | user 0m0.964s |
342 | sys 0m0.008s |