856ae896db015cbe13c24798bf06b98295e9373e
[svn/Cll1h/.git] / demos / performance / test-results2
1 AMD Athlon(tm) XP 1259.392 Mhz 2520.58 bogomips
2 ------------------------------------------------------------- Ruby
3 #!/usr/bin/ruby
4
5 10000000.times { print "stuff1"," ","stuff2","\n" }
6
7 Running...
8 real 1m50.369s
9 user 1m0.120s
10 sys 0m2.332s
11
12 --------------------------------------------------- Python - range
13 #!/usr/bin/python
14
15 for i in range(1,10000000):
16 print "stuff1","stuff2"
17
18 Running...
19 real 0m54.919s
20 user 0m30.274s
21 sys 0m0.564s
22
23 -------------------------------------------------- Python - xrange
24 #!/usr/bin/python
25
26 for i in xrange(1,10000000):
27 print "stuff1","stuff2"
28
29 Running...
30 real 0m50.106s
31 user 0m27.758s
32 sys 0m0.136s
33
34 ------------------------------------------------------------ PHP 5
35 #!/usr/bin/php5 -q
36 <?php
37 for ( $i=0; $i<10000000; $i++ )
38 {
39 echo "stuff1"." "."stuff2"."\n";
40 }
41 ?>
42 Running...
43 real 0m34.079s
44 user 0m16.805s
45 sys 0m4.916s
46
47 -------------------------------------------------- C - gcc - write
48 #include <string.h>
49
50 #define RUNS 10000000UL
51 int main (void)
52 {
53 unsigned long i;
54 char *s1="stuff1";
55 char *s2="stuff2";
56 int l1=strlen(s1);
57 int l2=strlen(s2);
58
59 for (i=0;i<RUNS;i++)
60 {
61 write(1,s1,l1);
62 write(1," ",1);
63 write(1,s2,l2);
64 write(1,"\n",1);
65 }
66 return 0;
67 }
68 Compiling...
69 real 0m0.494s
70 user 0m0.196s
71 sys 0m0.036s
72 Running...
73 real 1m8.226s
74 user 0m7.984s
75 sys 0m19.985s
76
77 ---------------------------------------------- C - g++ - std::cout
78 #include <iostream>
79
80 #define RUNS 10000000UL
81 int main()
82 {
83 unsigned long i;
84 for (i=0;i<RUNS;i++) {
85 std::cout << "stuff1" << " " << "stuff2" << std::endl;
86 }
87 return 0;
88 }
89 Compiling...
90 real 0m8.042s
91 user 0m1.176s
92 sys 0m0.132s
93 Running...
94 real 0m33.827s
95 user 0m11.369s
96 sys 0m3.908s
97
98 ------------------------------------------------------------- Perl
99 #!/usr/bin/perl
100
101 my $i=0;
102 for ($i=0;$i<10000000;$i++)
103 {
104 print ("stuff1"," ","stuff2","\n");
105 }
106 Running...
107 real 0m29.584s
108 user 0m14.577s
109 sys 0m0.088s
110
111 ------------------------------------------------- C - tcc - printf
112 #include <stdio.h>
113
114 #define RUNS 10000000UL
115 int main (void)
116 {
117 unsigned long i;
118 for (i=0;i<RUNS;i++)
119 {
120 printf("%s %s\n","stuff2","stuff2");
121 }
122 return 0;
123 }
124 Compiling...
125 real 0m0.014s
126 user 0m0.004s
127 sys 0m0.008s
128 Running...
129 real 0m11.628s
130 user 0m5.564s
131 sys 0m0.064s
132
133 ------------------------------------------------- C - tcc - fwrite
134 #include <stdio.h>
135 #include <string.h>
136
137 #define RUNS 10000000UL
138 int main (void)
139 {
140 unsigned long i;
141 char *s1="stuff1";
142 char *s2="stuff2";
143 int l1=strlen(s1);
144 int l2=strlen(s2);
145
146 for (i=0;i<RUNS;i++)
147 {
148 fwrite(s1,l1,1,stdout);
149 fwrite(" ",1,1,stdout);
150 fwrite(s2,l2,1,stdout);
151 fwrite("\n",1,1,stdout);
152 }
153 return 0;
154 }
155 Compiling...
156 real 0m0.017s
157 user 0m0.004s
158 sys 0m0.004s
159 Running...
160 real 0m8.379s
161 user 0m4.004s
162 sys 0m0.036s
163
164 ----------------------------------------------- C<<1 - tcc - print
165 #include "cll1.h"
166
167 program
168 {
169 repeat(10000000)
170 print("stuff1","stuff2");
171 }
172 Compiling...
173 real 0m0.029s
174 user 0m0.024s
175 sys 0m0.000s
176 Running...
177 real 0m16.690s
178 user 0m6.224s
179 sys 0m0.040s
180
181 -------------------------------------------------- C - tcc - fputs
182 #include <stdio.h>
183
184 #define RUNS 10000000UL
185 int main (void)
186 {
187 unsigned long i;
188 for (i=0;i<RUNS;i++) {
189 fputs("stuff1",stdout);
190 fputs(" ",stdout);
191 fputs("stuff2",stdout);
192 fputs("\n",stdout);
193 }
194 return 0;
195 }
196 Compiling...
197 real 0m0.016s
198 user 0m0.008s
199 sys 0m0.008s
200 Running...
201 real 0m8.072s
202 user 0m4.608s
203 sys 0m0.068s
204
205 ------------------------------------------------- C - gcc - printf
206 #include <stdio.h>
207
208 #define RUNS 10000000UL
209 int main (void)
210 {
211 unsigned long i;
212 for (i=0;i<RUNS;i++)
213 {
214 printf("%s %s\n","stuff2","stuff2");
215 }
216 return 0;
217 }
218 Compiling...
219 real 0m0.249s
220 user 0m0.196s
221 sys 0m0.028s
222 Running...
223 real 0m7.017s
224 user 0m5.368s
225 sys 0m0.028s
226
227 ------------------------------------------------- C - gcc - fwrite
228 #include <stdio.h>
229 #include <string.h>
230
231 #define RUNS 10000000UL
232 int main (void)
233 {
234 unsigned long i;
235 char *s1="stuff1";
236 char *s2="stuff2";
237 int l1=strlen(s1);
238 int l2=strlen(s2);
239
240 for (i=0;i<RUNS;i++)
241 {
242 fwrite(s1,l1,1,stdout);
243 fwrite(" ",1,1,stdout);
244 fwrite(s2,l2,1,stdout);
245 fwrite("\n",1,1,stdout);
246 }
247 return 0;
248 }
249 Compiling...
250 real 0m0.417s
251 user 0m0.216s
252 sys 0m0.024s
253 Running...
254 real 0m5.814s
255 user 0m3.960s
256 sys 0m0.032s
257
258 ----------------------------------------------- C<<1 - gcc - print
259 #include "cll1.h"
260
261 program
262 {
263 repeat(10000000)
264 print("stuff1","stuff2");
265 }
266 Compiling...
267 real 0m0.579s
268 user 0m0.412s
269 sys 0m0.056s
270 Running...
271 real 0m6.531s
272 user 0m4.896s
273 sys 0m0.052s
274
275 -------------------------------------------------- C - gcc - fputs
276 #include <stdio.h>
277
278 #define RUNS 10000000UL
279 int main (void)
280 {
281 unsigned long i;
282 for (i=0;i<RUNS;i++) {
283 fputs("stuff1",stdout);
284 fputs(" ",stdout);
285 fputs("stuff2",stdout);
286 fputs("\n",stdout);
287 }
288 return 0;
289 }
290 Compiling...
291 real 0m0.261s
292 user 0m0.200s
293 sys 0m0.040s
294 Running...
295 real 0m3.596s
296 user 0m2.784s
297 sys 0m0.028s
This page took 0.314096 seconds and 3 git commands to generate.