binary B+ tree - first attempt, compiles and runs
[svn/Cll1h/.git] / demos / performance / test-results2
CommitLineData
45cf8709 1AMD Athlon(tm) XP 1259.392 Mhz 2520.58 bogomips
2------------------------------------------------------------- Ruby
3#!/usr/bin/ruby
4
510000000.times { print "stuff1"," ","stuff2","\n" }
6
7Running...
c71d5ab7 8real 0m50.940s
9user 0m49.107s
10sys 0m1.836s
45cf8709 11
12--------------------------------------------------- Python - range
13#!/usr/bin/python
14
15for i in range(1,10000000):
16 print "stuff1","stuff2"
17
18Running...
c71d5ab7 19real 0m25.547s
20user 0m25.230s
21sys 0m0.320s
45cf8709 22
23-------------------------------------------------- Python - xrange
24#!/usr/bin/python
25
26for i in xrange(1,10000000):
27 print "stuff1","stuff2"
28
29Running...
c71d5ab7 30real 0m26.269s
31user 0m26.254s
32sys 0m0.016s
45cf8709 33
34------------------------------------------------------------ PHP 5
35#!/usr/bin/php5 -q
36<?php
37for ( $i=0; $i<10000000; $i++ )
38{
39 echo "stuff1"." "."stuff2"."\n";
40}
41?>
42Running...
c71d5ab7 43real 0m18.649s
44user 0m14.449s
45sys 0m4.200s
45cf8709 46
06ab91f0 47-------------------------------------------------- C - gcc - write
67db9ef1 48#include <string.h>
49
50#define RUNS 10000000UL
51int 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}
06ab91f0 68Compiling...
c71d5ab7 69real 0m0.188s
70user 0m0.164s
71sys 0m0.024s
06ab91f0 72Running...
c71d5ab7 73real 0m21.353s
74user 0m7.572s
75sys 0m13.781s
06ab91f0 76
77---------------------------------------------- C - g++ - std::cout
d8394559 78#include <iostream>
79
80#define RUNS 10000000UL
81int 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}
06ab91f0 89Compiling...
c71d5ab7 90real 0m0.986s
91user 0m0.904s
92sys 0m0.080s
06ab91f0 93Running...
c71d5ab7 94real 0m14.836s
95user 0m10.425s
96sys 0m4.416s
06ab91f0 97
98------------------------------------------------------------- Perl
81088cec 99#!/usr/bin/perl
100
101my $i=0;
102for ($i=0;$i<10000000;$i++)
103{
104 print ("stuff1"," ","stuff2","\n");
105}
2814fb59 106Running...
c71d5ab7 107real 0m14.115s
108user 0m13.005s
109sys 0m0.012s
2814fb59 110
111------------------------------------------------- C - tcc - printf
112#include <stdio.h>
06ab91f0 113
2814fb59 114#define RUNS 10000000UL
115int 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}
45cf8709 124Compiling...
c71d5ab7 125real 0m0.012s
126user 0m0.008s
127sys 0m0.004s
2814fb59 128Running...
c71d5ab7 129real 0m4.987s
130user 0m4.856s
131sys 0m0.032s
2814fb59 132
133------------------------------------------------- C - tcc - fwrite
134#include <stdio.h>
135#include <string.h>
136
137#define RUNS 10000000UL
138int 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}
45cf8709 155Compiling...
156real 0m0.017s
c71d5ab7 157user 0m0.012s
45cf8709 158sys 0m0.004s
a30ccb5a 159Running...
c71d5ab7 160real 0m3.678s
161user 0m3.672s
162sys 0m0.004s
2814fb59 163
164----------------------------------------------- C<<1 - tcc - print
165#include "cll1.h"
166
167program
168{
169 repeat(10000000)
170 print("stuff1","stuff2");
171}
45cf8709 172Compiling...
c71d5ab7 173real 0m0.022s
174user 0m0.016s
175sys 0m0.004s
2814fb59 176Running...
c71d5ab7 177real 0m4.853s
178user 0m4.836s
179sys 0m0.016s
2814fb59 180
181-------------------------------------------------- C - tcc - fputs
182#include <stdio.h>
183
184#define RUNS 10000000UL
185int 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}
45cf8709 196Compiling...
c71d5ab7 197real 0m0.012s
45cf8709 198user 0m0.008s
c71d5ab7 199sys 0m0.004s
2814fb59 200Running...
c71d5ab7 201real 0m4.065s
202user 0m4.040s
203sys 0m0.024s
81088cec 204
06ab91f0 205------------------------------------------------- C - gcc - printf
81088cec 206#include <stdio.h>
207
208#define RUNS 10000000UL
209int main (void)
210{
211 unsigned long i;
06ab91f0 212 for (i=0;i<RUNS;i++)
213 {
81088cec 214 printf("%s %s\n","stuff2","stuff2");
215 }
216 return 0;
217}
06ab91f0 218Compiling...
c71d5ab7 219real 0m0.180s
220user 0m0.152s
a30ccb5a 221sys 0m0.028s
06ab91f0 222Running...
c71d5ab7 223real 0m4.877s
224user 0m4.860s
225sys 0m0.020s
06ab91f0 226
227------------------------------------------------- C - gcc - fwrite
228#include <stdio.h>
229#include <string.h>
283bc497 230
06ab91f0 231#define RUNS 10000000UL
232int 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}
249Compiling...
c71d5ab7 250real 0m0.205s
251user 0m0.156s
252sys 0m0.048s
06ab91f0 253Running...
c71d5ab7 254real 0m3.640s
255user 0m3.620s
256sys 0m0.020s
06ab91f0 257
258----------------------------------------------- C<<1 - gcc - print
283bc497 259#include "cll1.h"
260
261program
262{
263 repeat(10000000)
264 print("stuff1","stuff2");
265}
06ab91f0 266Compiling...
c71d5ab7 267real 0m0.378s
268user 0m0.336s
269sys 0m0.040s
06ab91f0 270Running...
c71d5ab7 271real 0m4.457s
272user 0m4.448s
273sys 0m0.012s
06ab91f0 274
275-------------------------------------------------- C - gcc - fputs
81088cec 276#include <stdio.h>
277
278#define RUNS 10000000UL
279int 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}
06ab91f0 290Compiling...
c71d5ab7 291real 0m0.190s
292user 0m0.172s
293sys 0m0.020s
06ab91f0 294Running...
c71d5ab7 295real 0m2.556s
296user 0m2.544s
297sys 0m0.012s
This page took 0.599184 seconds and 4 git commands to generate.