Major header file rewrite and cleanup, but no new functions
[svn/Cll1h/.git] / demos / performance / test-results
CommitLineData
06ab91f0 1------------------------------------------------------------- Ruby
b84246fd 2#!/usr/bin/ruby
3
410000000.times { print "stuff","\n" }
283bc497 5
06ab91f0 6Running...
7real 0m16.104s
8user 0m14.353s
9sys 0m1.412s
10--------------------------------------------------- Python - range
b836e242 11#!/usr/bin/python
81088cec 12
13for i in range(1,10000000):
14 print "stuff"
15
06ab91f0 16Running...
17real 0m8.661s
18user 0m8.465s
19sys 0m0.168s
20-------------------------------------------------- Python - xrange
72c9d7a0 21#!/usr/bin/python
22
23for i in xrange(1,10000000):
24 print "stuff"
25
06ab91f0 26Running...
27real 0m8.480s
28user 0m8.433s
29sys 0m0.016s
30------------------------------------------------------------ PHP 5
ba41861f 31#!/usr/bin/php5 -q
32<?php
33for ( $i=0; $i<10000000; $i++ )
34{
35 echo "stuff1\n";
36}
37?>
06ab91f0 38Running...
39real 0m7.098s
40user 0m5.048s
41sys 0m2.024s
42-------------------------------------------------- C - gcc - write
67db9ef1 43#include <string.h>
44
45#define RUNS 10000000UL
46int main (void)
47{
48 unsigned long i;
49 char *s1="stuff\n";
50 int l1=strlen(s1);
51
06ab91f0 52 for (i=0;i<RUNS;i++)
53 {
54 write(1,s1,l1);
55 }
56 return 0;
67db9ef1 57}
06ab91f0 58Compiling...
59real 0m0.061s
60user 0m0.048s
61sys 0m0.012s
62Running...
63real 0m2.906s
64user 0m0.848s
65sys 0m2.028s
66------------------------------------------------------------- Perl
ba41861f 67#!/usr/bin/perl
68
69my $i=0;
70for ($i=0;$i<10000000;$i++)
71{
72 print ("stuff");
73}
74
06ab91f0 75Running...
76real 0m2.515s
77user 0m2.484s
78sys 0m0.008s
79----------------------------------------------- C<<1 - gcc - print
80#include "cll1.h"
283bc497 81
06ab91f0 82program
83{
84 repeat(10000000)
85 print("stuff");
86}
87Compiling...
88real 0m0.121s
89user 0m0.112s
90sys 0m0.008s
91Running...
92real 0m1.249s
93user 0m1.240s
94sys 0m0.004s
95---------------------------------------------- C - g++ - std::cout
d8394559 96#include <iostream>
97
98#define RUNS 10000000UL
99int main()
100{
101 unsigned long i;
06ab91f0 102 for (i=0;i<RUNS;i++)
103 {
104 std::cout << "stuff\n";
d8394559 105 }
106 return 0;
107}
06ab91f0 108Compiling...
109real 0m0.362s
110user 0m0.320s
111sys 0m0.036s
112Running...
113real 0m0.990s
114user 0m0.984s
115sys 0m0.004s
116-----------------------------------------------= C<<1 - gcc - echo
81088cec 117#include "cll1.h"
118
119program
120{
06ab91f0 121 unsigned long i;
122 for_range(i,1,10000000)
123 echo("stuff\n");
81088cec 124}
06ab91f0 125Compiling...
126real 0m0.117s
127user 0m0.100s
128sys 0m0.008s
129Running...
130real 0m0.757s
131user 0m0.744s
132sys 0m0.000s
133------------------------------------------------- C - gcc - printf
81088cec 134#include <stdio.h>
135
136#define RUNS 10000000UL
137int main (void)
138{
06ab91f0 139 unsigned long i;
140 for (i=0;i<RUNS;i++)
141 {
142 printf("stuff\n");
143 }
144 return 0;
81088cec 145}
06ab91f0 146Compiling...
147real 0m0.067s
148user 0m0.040s
149sys 0m0.024s
150Running...
151real 0m0.630s
152user 0m0.608s
153sys 0m0.012s
154--------------------------------------------------- C - gcc - puts
e1fbb836 155#include <stdio.h>
156
157#define RUNS 10000000UL
158int main (void)
159{
06ab91f0 160 unsigned long i;
161 for (i=0;i<RUNS;i++)
162 {
163 puts("stuff");
164 }
165 return 0;
e1fbb836 166}
06ab91f0 167Compiling...
168real 0m0.058s
169user 0m0.036s
170sys 0m0.024s
171Running...
172real 0m0.633s
173user 0m0.632s
174sys 0m0.000s
175------------------------------------------------- C - gcc - fwrite
e1fbb836 176#include <stdio.h>
177#include <string.h>
178
179#define RUNS 10000000UL
180int main (void)
181{
182 unsigned long i;
183 char *s1="stuff\n";
184 int l1=strlen(s1);
185
186 for (i=0;i<RUNS;i++)
187 {
188 fwrite(s1,l1,1,stdout);
189 }
190 return 0;
191}
06ab91f0 192Compiling...
193real 0m0.137s
194user 0m0.060s
195sys 0m0.008s
196Running...
197real 0m0.555s
198user 0m0.548s
199sys 0m0.004s
200-------------------------------------------------- C - gcc - fputs
201#include <stdio.h>
202
203#define RUNS 10000000UL
204int main (void)
205{
206 unsigned long i;
207 for (i=0;i<RUNS;i++)
208 {
209 fputs("stuff\n",stdout);
210 }
211 return 0;
212}
213Compiling...
214real 0m0.058s
215user 0m0.040s
216sys 0m0.016s
217Running...
218real 0m0.551s
219user 0m0.548s
220sys 0m0.004s
This page took 0.328111 seconds and 4 git commands to generate.