TRUE, FALSE and MAYBE
authorxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 13:30:33 +0000 (13:30 +0000)
committerxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 13:30:33 +0000 (13:30 +0000)
git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@35 4bb87942-c103-4e5a-b51c-0ebff58f8515

cll1.h
demos/boolean.c
demos/performance/test-performance.sh
demos/performance/test-performance2.sh
demos/performance/test-results
demos/performance/test-results2

diff --git a/cll1.h b/cll1.h
index 81f4887429725c08fb34b9397fdaaa47fa75f8f4..a20121df0cd62b356180b42dc92c079f55e34e94 100644 (file)
--- a/cll1.h
+++ b/cll1.h
@@ -46,6 +46,7 @@
 #define or ||
 #define TRUE 1
 #define FALSE 0
+#define MAYBE (random()%2)
 #define bool_str(I) (I?"TRUE":"FALSE")
 #define boolean int
 #define mem struct
index 1b5f1e2293e946a8018ab8146ff0b124a630a767..aee578c514ecff1c3823044513809acf27ac65d1 100644 (file)
@@ -2,10 +2,13 @@
 
 program
 {
- boolean t=TRUE,f=FALSE;
+ boolean t = TRUE, f = FALSE, m = MAYBE;
 
  print("TRUE and FALSE = ", bool_str(t and f) );
  print("TRUE or FALSE = ", bool_str(t or f) );
+ print("TRUE and MAYBE = ", bool_str(t and m) );
+ print("FALSE or MAYBE = ", bool_str(t or m) );
  print("not FALSE = ", bool_str(not f) );
  print("not TRUE = ", bool_str(not t) );
+ print("not MAYBE = ", bool_str(not m) );
 }
index de10bad2c0c54063b38bec89448999402d3e242a..de36065d590cbd5acb2b858794da125d63f6df07 100755 (executable)
@@ -2,59 +2,59 @@
 
 cat print.rb
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print.rb > /dev/null
+time -f  "%E total, %U user, %S sys" ./print.rb > /dev/null
 echo
 
 cat print.py
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print.py > /dev/null
+time -f  "%E total, %U user, %S sys" ./print.py > /dev/null
 echo
 
 cat xrange.py
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./xrange.py > /dev/null
+time -f  "%E total, %U user, %S sys" ./xrange.py > /dev/null
 echo
 
 cat echo.php
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./echo.php > /dev/null
+time -f  "%E total, %U user, %S sys" ./echo.php > /dev/null
 echo
 
 cat print.pl
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print.pl > /dev/null
+time -f  "%E total, %U user, %S sys" ./print.pl > /dev/null
 echo
 
 cat cout.cpp
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" g++ -O2 cout.cpp -o cout
+time -f  "%E total, %U user, %S sys" g++ -O2 cout.cpp -o cout
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./cout > /dev/null
+time -f  "%E total, %U user, %S sys" ./cout > /dev/null
 
 echo
 cat cll1-print.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 cll1-print.c -o cll1-print
+time -f  "%E total, %U user, %S sys" gcc -O2 cll1-print.c -o cll1-print
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./cll1-print > /dev/null
+time -f  "%E total, %U user, %S sys" ./cll1-print > /dev/null
 echo
 
 cat printf.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 printf.c -o printf
+time -f  "%E total, %U user, %S sys" gcc -O2 printf.c -o printf
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./printf > /dev/null
+time -f  "%E total, %U user, %S sys" ./printf > /dev/null
 echo
 
 cat puts.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 puts.c -o puts
+time -f  "%E total, %U user, %S sys" gcc -O2 puts.c -o puts
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./puts > /dev/null
+time -f  "%E total, %U user, %S sys" ./puts > /dev/null
 echo
 
 cat fputs.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 fputs.c -o fputs
+time -f  "%E total, %U user, %S sys" gcc -O2 fputs.c -o fputs
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./fputs > /dev/null
+time -f  "%E total, %U user, %S sys" ./fputs > /dev/null
index ded38de5e888c966715713b2f241cf1cfeb4abb3..f4a33ad80673f22a41a81c5560e788bb6dc292dc 100755 (executable)
@@ -2,53 +2,53 @@
 
 cat print2.rb
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print2.rb > /dev/null
+time -f  "%E total, %U user, %S sys" ./print2.rb > /dev/null
 echo
 
 cat print2.py
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print2.py > /dev/null
+time -f  "%E total, %U user, %S sys" ./print2.py > /dev/null
 echo
 
 cat xrange2.py
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./xrange2.py > /dev/null
+time -f  "%E total, %U user, %S sys" ./xrange2.py > /dev/null
 echo
 
 cat echo2.php
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./echo2.php > /dev/null
+time -f  "%E total, %U user, %S sys" ./echo2.php > /dev/null
 echo
 
 cat cout2.cpp
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" g++ -O2 cout2.cpp -o cout2
+time -f  "%E total, %U user, %S sys" g++ -O2 cout2.cpp -o cout2
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./cout2 > /dev/null
+time -f  "%E total, %U user, %S sys" ./cout2 > /dev/null
 echo
 
 cat print2.pl
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./print2.pl > /dev/null
+time -f  "%E total, %U user, %S sys" ./print2.pl > /dev/null
 echo
 
 cat printf2.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 printf2.c -o printf2
+time -f  "%E total, %U user, %S sys" gcc -O2 printf2.c -o printf2
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./printf2 > /dev/null
+time -f  "%E total, %U user, %S sys" ./printf2 > /dev/null
 echo
 
 cat cll1-print2.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 cll1-print2.c -o cll1-print2
+time -f  "%E total, %U user, %S sys" gcc -O2 cll1-print2.c -o cll1-print2
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./cll1-print2 > /dev/null
+time -f  "%E total, %U user, %S sys" ./cll1-print2 > /dev/null
 echo
 
 cat fputs2.c
 echo -n "Compiling..."
-time -f  "%E total, %U user, %S sys, %t KB average size" gcc -O2 fputs2.c -o fputs2
+time -f  "%E total, %U user, %S sys" gcc -O2 fputs2.c -o fputs2
 echo -n "Running..."
-time -f  "%E total, %U user, %S sys, %t KB average size" ./fputs2 > /dev/null
+time -f  "%E total, %U user, %S sys" ./fputs2 > /dev/null
 echo
index 8415d1ee6248287df19895d77b3957a534925277..2ccb4009540a35baa62544a8a8a34eeed5206a8c 100644 (file)
@@ -1,21 +1,21 @@
 #!/usr/bin/ruby
 
 10000000.times { print "stuff","\n" }
-Running...0:16.51 total, 14.79 user, 1.51 sys, 0 KB average size
+Running...0:16.66 total, 14.64 user, 1.70 sys
 
 #!/usr/bin/python
 
 for i in range(1,10000000):
  print "stuff"
 
-Running...0:09.04 total, 8.58 user, 0.20 sys, 0 KB average size
+Running...0:09.24 total, 8.48 user, 0.15 sys
 
 #!/usr/bin/python
 
 for i in xrange(1,10000000):
  print "stuff"
 
-Running...0:08.22 total, 8.15 user, 0.00 sys, 0 KB average size
+Running...0:08.31 total, 8.14 user, 0.01 sys
 
 #!/usr/bin/php5 -q
 <?php
@@ -24,7 +24,7 @@ for ( $i=0; $i<10000000; $i++ )
  echo "stuff1\n";
 }
 ?>
-Running...0:07.13 total, 5.00 user, 2.10 sys, 0 KB average size
+Running...0:07.30 total, 4.92 user, 2.09 sys
 
 #!/usr/bin/perl
 
@@ -34,7 +34,7 @@ for ($i=0;$i<10000000;$i++)
  print ("stuff");
 }
 
-Running...0:02.52 total, 2.50 user, 0.00 sys, 0 KB average size
+Running...0:02.48 total, 2.48 user, 0.00 sys
 
 #include <iostream>
 
@@ -47,8 +47,8 @@ int main()
  }
  return 0;
 }
-Compiling...0:00.37 total, 0.32 user, 0.04 sys, 0 KB average size
-Running...0:01.00 total, 1.00 user, 0.00 sys, 0 KB average size
+Compiling...0:00.37 total, 0.33 user, 0.04 sys
+Running...0:01.10 total, 1.05 user, 0.00 sys
 
 #include "cll1.h"
 
@@ -57,8 +57,8 @@ program
  repeat(10000000)
   print("stuff");
 }
-Compiling...0:00.09 total, 0.07 user, 0.02 sys, 0 KB average size
-Running...0:00.88 total, 0.88 user, 0.00 sys, 0 KB average size
+Compiling...0:00.09 total, 0.08 user, 0.01 sys
+Running...0:00.98 total, 0.91 user, 0.00 sys
 
 #include <stdio.h>
 
@@ -71,8 +71,8 @@ printf("stuff\n");
 }
 return 0;
 }
-Compiling...0:00.05 total, 0.04 user, 0.00 sys, 0 KB average size
-Running...0:00.67 total, 0.65 user, 0.02 sys, 0 KB average size
+Compiling...0:00.07 total, 0.06 user, 0.01 sys
+Running...0:00.62 total, 0.62 user, 0.00 sys
 
 #include <stdio.h>
 
@@ -85,8 +85,8 @@ puts("stuff");
 }
 return 0;
 }
-Compiling...0:00.09 total, 0.06 user, 0.02 sys, 0 KB average size
-Running...0:00.62 total, 0.62 user, 0.00 sys, 0 KB average size
+Compiling...0:00.06 total, 0.04 user, 0.01 sys
+Running...0:00.65 total, 0.62 user, 0.00 sys
 
 #include <stdio.h>
 
@@ -99,5 +99,5 @@ fputs("stuff\n",stdout);
 }
 return 0;
 }
-Compiling...0:00.06 total, 0.05 user, 0.00 sys, 0 KB average size
-Running...0:00.55 total, 0.55 user, 0.00 sys, 0 KB average size
+Compiling...0:00.06 total, 0.05 user, 0.00 sys
+Running...0:00.55 total, 0.55 user, 0.00 sys
index e0876053bd32ec8dd19a2d7caff10a0d4fcbffc6..6948e05e5f89f1c27eb6b96895ab4b00a2f45540 100644 (file)
@@ -1,21 +1,21 @@
 #!/usr/bin/ruby
 
 10000000.times { print "stuff1"," ","stuff2","\n" }
-Running...0:24.98 total, 23.33 user, 1.54 sys, 0 KB average size
+Running...0:25.02 total, 23.30 user, 1.58 sys
 
 #!/usr/bin/python
 
 for i in range(1,10000000):
  print "stuff1","stuff2"
 
-Running...0:13.82 total, 13.59 user, 0.19 sys, 0 KB average size
+Running...0:13.46 total, 13.27 user, 0.18 sys
 
 #!/usr/bin/python
 
 for i in xrange(1,10000000):
  print "stuff1","stuff2"
 
-Running...0:13.24 total, 13.22 user, 0.00 sys, 0 KB average size
+Running...0:12.92 total, 12.89 user, 0.01 sys
 
 #!/usr/bin/php5 -q
 <?php 
@@ -24,7 +24,7 @@ for ( $i=0; $i<10000000; $i++ )
  echo "stuff1"." "."stuff2"."\n";
 }
 ?>
-Running...0:11.87 total, 9.74 user, 2.06 sys, 0 KB average size
+Running...0:11.38 total, 9.38 user, 2.00 sys
 
 #include <iostream>
 
@@ -37,8 +37,8 @@ int main()
  }
  return 0;
 }
-Compiling...0:00.37 total, 0.34 user, 0.03 sys, 0 KB average size
-Running...0:08.07 total, 6.14 user, 1.92 sys, 0 KB average size
+Compiling...0:00.36 total, 0.32 user, 0.04 sys
+Running...0:08.22 total, 6.07 user, 2.03 sys
 
 #!/usr/bin/perl
 
@@ -47,7 +47,7 @@ for ($i=0;$i<10000000;$i++)
 {
  print ("stuff1"," ","stuff2","\n");
 }
-Running...0:05.66 total, 5.64 user, 0.01 sys, 0 KB average size
+Running...0:05.74 total, 5.73 user, 0.00 sys
 
 #include <stdio.h>
 
@@ -60,8 +60,8 @@ int main (void)
  }
  return 0;
 }
-Compiling...0:00.06 total, 0.05 user, 0.00 sys, 0 KB average size
-Running...0:02.85 total, 2.84 user, 0.00 sys, 0 KB average size
+Compiling...0:00.05 total, 0.02 user, 0.02 sys
+Running...0:02.85 total, 2.84 user, 0.01 sys
 
 #include "cll1.h"
 
@@ -70,8 +70,8 @@ program
  repeat(10000000)
   print("stuff1","stuff2");
 }
-Compiling...0:00.10 total, 0.07 user, 0.02 sys, 0 KB average size
-Running...0:01.92 total, 1.92 user, 0.00 sys, 0 KB average size
+Compiling...0:00.09 total, 0.07 user, 0.02 sys
+Running...0:01.94 total, 1.92 user, 0.01 sys
 
 #include <stdio.h>
 
@@ -87,6 +87,6 @@ int main (void)
  }
  return 0;
 }
-Compiling...0:00.08 total, 0.04 user, 0.02 sys, 0 KB average size
-Running...0:01.53 total, 1.50 user, 0.00 sys, 0 KB average size
+Compiling...0:00.14 total, 0.04 user, 0.01 sys
+Running...0:01.56 total, 1.53 user, 0.01 sys
 
This page took 0.472294 seconds and 4 git commands to generate.