Tiny C test added
[svn/Cll1h/.git] / demos / performance / test-results2
CommitLineData
2814fb59 1AMD Athlon(tm) XP 1259.487 Mhz 2522.30 bogomips
06ab91f0 2-------------------------------------------------- C - gcc - write
67db9ef1 3#include <string.h>
4
5#define RUNS 10000000UL
6int main (void)
7{
8 unsigned long i;
9 char *s1="stuff1";
10 char *s2="stuff2";
11 int l1=strlen(s1);
12 int l2=strlen(s2);
13
14 for (i=0;i<RUNS;i++)
15 {
16 write(1,s1,l1);
17 write(1," ",1);
18 write(1,s2,l2);
19 write(1,"\n",1);
20 }
21 return 0;
22}
06ab91f0 23Compiling...
2814fb59 24real 0m0.205s
25user 0m0.172s
26sys 0m0.032s
06ab91f0 27Running...
2814fb59 28real 0m28.001s
29user 0m6.400s
30sys 0m21.597s
06ab91f0 31
32---------------------------------------------- C - g++ - std::cout
d8394559 33#include <iostream>
34
35#define RUNS 10000000UL
36int main()
37{
38 unsigned long i;
39 for (i=0;i<RUNS;i++) {
40 std::cout << "stuff1" << " " << "stuff2" << std::endl;
41 }
42 return 0;
43}
06ab91f0 44Compiling...
2814fb59 45real 0m1.087s
46user 0m0.988s
47sys 0m0.100s
06ab91f0 48Running...
2814fb59 49real 0m15.557s
50user 0m10.461s
51sys 0m5.096s
06ab91f0 52
53------------------------------------------------------------- Perl
81088cec 54#!/usr/bin/perl
55
56my $i=0;
57for ($i=0;$i<10000000;$i++)
58{
59 print ("stuff1"," ","stuff2","\n");
60}
2814fb59 61Running...
62real 0m10.660s
63user 0m10.361s
64sys 0m0.028s
65
66------------------------------------------------- C - tcc - printf
67#include <stdio.h>
06ab91f0 68
2814fb59 69#define RUNS 10000000UL
70int main (void)
71{
72 unsigned long i;
73 for (i=0;i<RUNS;i++)
74 {
75 printf("%s %s\n","stuff2","stuff2");
76 }
77 return 0;
78}
79Compiling...
80real 0m0.013s
06ab91f0 81user 0m0.000s
2814fb59 82sys 0m0.012s
83Running...
84real 0m5.387s
85user 0m5.316s
86sys 0m0.012s
87
88------------------------------------------------- C - tcc - fwrite
89#include <stdio.h>
90#include <string.h>
91
92#define RUNS 10000000UL
93int main (void)
94{
95 unsigned long i;
96 char *s1="stuff1";
97 char *s2="stuff2";
98 int l1=strlen(s1);
99 int l2=strlen(s2);
100
101 for (i=0;i<RUNS;i++)
102 {
103 fwrite(s1,l1,1,stdout);
104 fwrite(" ",1,1,stdout);
105 fwrite(s2,l2,1,stdout);
106 fwrite("\n",1,1,stdout);
107 }
108 return 0;
109}
110Compiling...
111real 0m0.015s
112user 0m0.008s
113sys 0m0.008s
114Running...
115real 0m3.751s
116user 0m3.708s
117sys 0m0.012s
118
119----------------------------------------------- C<<1 - tcc - print
120#include "cll1.h"
121
122program
123{
124 repeat(10000000)
125 print("stuff1","stuff2");
126}
127Compiling...
128real 0m0.022s
129user 0m0.020s
130sys 0m0.000s
131Running...
132real 0m4.780s
133user 0m4.716s
134sys 0m0.032s
135
136-------------------------------------------------- C - tcc - fputs
137#include <stdio.h>
138
139#define RUNS 10000000UL
140int main (void)
141{
142 unsigned long i;
143 for (i=0;i<RUNS;i++) {
144 fputs("stuff1",stdout);
145 fputs(" ",stdout);
146 fputs("stuff2",stdout);
147 fputs("\n",stdout);
148 }
149 return 0;
150}
151Compiling...
152real 0m0.012s
153user 0m0.008s
06ab91f0 154sys 0m0.004s
2814fb59 155Running...
156real 0m4.614s
157user 0m4.596s
158sys 0m0.020s
81088cec 159
06ab91f0 160------------------------------------------------- C - gcc - printf
81088cec 161#include <stdio.h>
162
163#define RUNS 10000000UL
164int main (void)
165{
166 unsigned long i;
06ab91f0 167 for (i=0;i<RUNS;i++)
168 {
81088cec 169 printf("%s %s\n","stuff2","stuff2");
170 }
171 return 0;
172}
06ab91f0 173Compiling...
2814fb59 174real 0m0.199s
175user 0m0.164s
176sys 0m0.036s
06ab91f0 177Running...
2814fb59 178real 0m5.027s
179user 0m4.996s
180sys 0m0.032s
06ab91f0 181
182------------------------------------------------- C - gcc - fwrite
183#include <stdio.h>
184#include <string.h>
283bc497 185
06ab91f0 186#define RUNS 10000000UL
187int main (void)
188{
189 unsigned long i;
190 char *s1="stuff1";
191 char *s2="stuff2";
192 int l1=strlen(s1);
193 int l2=strlen(s2);
194
195 for (i=0;i<RUNS;i++)
196 {
197 fwrite(s1,l1,1,stdout);
198 fwrite(" ",1,1,stdout);
199 fwrite(s2,l2,1,stdout);
200 fwrite("\n",1,1,stdout);
201 }
202 return 0;
203}
204Compiling...
2814fb59 205real 0m0.221s
206user 0m0.204s
06ab91f0 207sys 0m0.016s
208Running...
2814fb59 209real 0m3.770s
210user 0m3.664s
211sys 0m0.028s
06ab91f0 212
213----------------------------------------------- C<<1 - gcc - print
283bc497 214#include "cll1.h"
215
216program
217{
218 repeat(10000000)
219 print("stuff1","stuff2");
220}
06ab91f0 221Compiling...
2814fb59 222real 0m0.364s
223user 0m0.352s
224sys 0m0.012s
06ab91f0 225Running...
2814fb59 226real 0m4.519s
227user 0m4.504s
228sys 0m0.016s
06ab91f0 229
230-------------------------------------------------- C - gcc - fputs
81088cec 231#include <stdio.h>
232
233#define RUNS 10000000UL
234int main (void)
235{
236 unsigned long i;
237 for (i=0;i<RUNS;i++) {
238 fputs("stuff1",stdout);
239 fputs(" ",stdout);
240 fputs("stuff2",stdout);
241 fputs("\n",stdout);
242 }
243 return 0;
244}
06ab91f0 245Compiling...
2814fb59 246real 0m0.205s
247user 0m0.180s
248sys 0m0.024s
06ab91f0 249Running...
2814fb59 250real 0m2.642s
251user 0m2.612s
252sys 0m0.032s
This page took 0.297968 seconds and 4 git commands to generate.