+AMD Athlon(tm) XP 1259.392 Mhz 2520.58 bogomips
+------------------------------------------------------------- Ruby
#!/usr/bin/ruby
10000000.times { print "stuff1"," ","stuff2","\n" }
-Running...0:24.57 total, 23.03 user, 1.51 sys, 0 outputs
+Running...
+real 1m50.369s
+user 1m0.120s
+sys 0m2.332s
+
+--------------------------------------------------- Python - range
#!/usr/bin/python
for i in range(1,10000000):
print "stuff1","stuff2"
-Running...0:13.80 total, 13.53 user, 0.17 sys, 0 outputs
+Running...
+real 0m54.919s
+user 0m30.274s
+sys 0m0.564s
+-------------------------------------------------- Python - xrange
#!/usr/bin/python
for i in xrange(1,10000000):
print "stuff1","stuff2"
-Running...0:13.43 total, 13.20 user, 0.02 sys, 0 outputs
+Running...
+real 0m50.106s
+user 0m27.758s
+sys 0m0.136s
+------------------------------------------------------------ PHP 5
#!/usr/bin/php5 -q
<?php
for ( $i=0; $i<10000000; $i++ )
echo "stuff1"." "."stuff2"."\n";
}
?>
-Running...0:11.93 total, 9.84 user, 2.08 sys, 0 outputs
+Running...
+real 0m34.079s
+user 0m16.805s
+sys 0m4.916s
-#include <stdio.h>
+-------------------------------------------------- C - gcc - write
#include <string.h>
#define RUNS 10000000UL
}
return 0;
}
-Compiling...0:00.07 total, 0.06 user, 0.00 sys, 0 outputs
-Running...0:11.92 total, 3.78 user, 7.86 sys, 0 outputs
+Compiling...
+real 0m0.494s
+user 0m0.196s
+sys 0m0.036s
+Running...
+real 1m8.226s
+user 0m7.984s
+sys 0m19.985s
+---------------------------------------------- C - g++ - std::cout
#include <iostream>
#define RUNS 10000000UL
}
return 0;
}
-Compiling...0:00.38 total, 0.33 user, 0.05 sys, 0 outputs
-Running...0:08.22 total, 6.18 user, 2.01 sys, 0 outputs
+Compiling...
+real 0m8.042s
+user 0m1.176s
+sys 0m0.132s
+Running...
+real 0m33.827s
+user 0m11.369s
+sys 0m3.908s
+------------------------------------------------------------- Perl
#!/usr/bin/perl
my $i=0;
{
print ("stuff1"," ","stuff2","\n");
}
-Running...0:05.97 total, 5.96 user, 0.00 sys, 0 outputs
+Running...
+real 0m29.584s
+user 0m14.577s
+sys 0m0.088s
+------------------------------------------------- C - tcc - printf
#include <stdio.h>
#define RUNS 10000000UL
int main (void)
{
unsigned long i;
- for (i=0;i<RUNS;i++) {
+ for (i=0;i<RUNS;i++)
+ {
printf("%s %s\n","stuff2","stuff2");
}
return 0;
}
-Compiling...0:00.06 total, 0.05 user, 0.00 sys, 0 outputs
-Running...0:02.87 total, 2.84 user, 0.01 sys, 0 outputs
+Compiling...
+real 0m0.014s
+user 0m0.004s
+sys 0m0.008s
+Running...
+real 0m11.628s
+user 0m5.564s
+sys 0m0.064s
+
+------------------------------------------------- C - tcc - fwrite
+#include <stdio.h>
+#include <string.h>
+
+#define RUNS 10000000UL
+int main (void)
+{
+ unsigned long i;
+ char *s1="stuff1";
+ char *s2="stuff2";
+ int l1=strlen(s1);
+ int l2=strlen(s2);
+
+ for (i=0;i<RUNS;i++)
+ {
+ fwrite(s1,l1,1,stdout);
+ fwrite(" ",1,1,stdout);
+ fwrite(s2,l2,1,stdout);
+ fwrite("\n",1,1,stdout);
+ }
+ return 0;
+}
+Compiling...
+real 0m0.017s
+user 0m0.004s
+sys 0m0.004s
+Running...
+real 0m8.379s
+user 0m4.004s
+sys 0m0.036s
+----------------------------------------------- C<<1 - tcc - print
#include "cll1.h"
program
repeat(10000000)
print("stuff1","stuff2");
}
-Compiling...0:00.14 total, 0.12 user, 0.00 sys, 0 outputs
-Running...0:02.77 total, 2.76 user, 0.00 sys, 0 outputs
+Compiling...
+real 0m0.029s
+user 0m0.024s
+sys 0m0.000s
+Running...
+real 0m16.690s
+user 0m6.224s
+sys 0m0.040s
+-------------------------------------------------- C - tcc - fputs
#include <stdio.h>
#define RUNS 10000000UL
}
return 0;
}
-Compiling...0:00.07 total, 0.04 user, 0.02 sys, 0 outputs
-Running...0:01.52 total, 1.52 user, 0.00 sys, 0 outputs
+Compiling...
+real 0m0.016s
+user 0m0.008s
+sys 0m0.008s
+Running...
+real 0m8.072s
+user 0m4.608s
+sys 0m0.068s
+
+------------------------------------------------- C - gcc - printf
+#include <stdio.h>
+
+#define RUNS 10000000UL
+int main (void)
+{
+ unsigned long i;
+ for (i=0;i<RUNS;i++)
+ {
+ printf("%s %s\n","stuff2","stuff2");
+ }
+ return 0;
+}
+Compiling...
+real 0m0.249s
+user 0m0.196s
+sys 0m0.028s
+Running...
+real 0m7.017s
+user 0m5.368s
+sys 0m0.028s
+
+------------------------------------------------- C - gcc - fwrite
+#include <stdio.h>
+#include <string.h>
+
+#define RUNS 10000000UL
+int main (void)
+{
+ unsigned long i;
+ char *s1="stuff1";
+ char *s2="stuff2";
+ int l1=strlen(s1);
+ int l2=strlen(s2);
+
+ for (i=0;i<RUNS;i++)
+ {
+ fwrite(s1,l1,1,stdout);
+ fwrite(" ",1,1,stdout);
+ fwrite(s2,l2,1,stdout);
+ fwrite("\n",1,1,stdout);
+ }
+ return 0;
+}
+Compiling...
+real 0m0.417s
+user 0m0.216s
+sys 0m0.024s
+Running...
+real 0m5.814s
+user 0m3.960s
+sys 0m0.032s
+
+----------------------------------------------- C<<1 - gcc - print
+#include "cll1.h"
+
+program
+{
+ repeat(10000000)
+ print("stuff1","stuff2");
+}
+Compiling...
+real 0m0.579s
+user 0m0.412s
+sys 0m0.056s
+Running...
+real 0m6.531s
+user 0m4.896s
+sys 0m0.052s
+-------------------------------------------------- C - gcc - fputs
+#include <stdio.h>
+
+#define RUNS 10000000UL
+int main (void)
+{
+ unsigned long i;
+ for (i=0;i<RUNS;i++) {
+ fputs("stuff1",stdout);
+ fputs(" ",stdout);
+ fputs("stuff2",stdout);
+ fputs("\n",stdout);
+ }
+ return 0;
+}
+Compiling...
+real 0m0.261s
+user 0m0.200s
+sys 0m0.040s
+Running...
+real 0m3.596s
+user 0m2.784s
+sys 0m0.028s