From 67db9ef19d8b36eb84357b6e6477b7791b59182f Mon Sep 17 00:00:00 2001 From: xchaos Date: Mon, 28 Jan 2008 21:08:27 +0000 Subject: [PATCH] update performance test git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@46 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- demos/performance/test-performance.sh | 38 ++++++++--------- demos/performance/test-performance2.sh | 33 +++++++++------ demos/performance/test-results | 56 ++++++++++++++------------ demos/performance/test-results2 | 50 +++++++++++++++++------ demos/performance/write.c | 15 +++++++ demos/performance/write2.c | 21 ++++++++++ 6 files changed, 142 insertions(+), 71 deletions(-) create mode 100644 demos/performance/write.c create mode 100644 demos/performance/write2.c diff --git a/demos/performance/test-performance.sh b/demos/performance/test-performance.sh index de36065..cadcbfd 100755 --- a/demos/performance/test-performance.sh +++ b/demos/performance/test-performance.sh @@ -2,59 +2,59 @@ cat print.rb echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print.rb > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print.rb > /dev/null echo cat print.py echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print.py > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print.py > /dev/null echo cat xrange.py echo -n "Running..." -time -f "%E total, %U user, %S sys" ./xrange.py > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./xrange.py > /dev/null echo cat echo.php echo -n "Running..." -time -f "%E total, %U user, %S sys" ./echo.php > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./echo.php > /dev/null echo +cat write.c +echo -n "Compiling..." +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 write.c -o write +echo -n "Running..." +time -f "%E total, %U user, %S sys, %O outputs" ./write > /dev/null + cat print.pl echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print.pl > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print.pl > /dev/null echo cat cout.cpp echo -n "Compiling..." -time -f "%E total, %U user, %S sys" g++ -O2 cout.cpp -o cout +time -f "%E total, %U user, %S sys, %O outputs" g++ -O2 cout.cpp -o cout echo -n "Running..." -time -f "%E total, %U user, %S sys" ./cout > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./cout > /dev/null echo cat cll1-print.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 cll1-print.c -o cll1-print +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 cll1-print.c -o cll1-print echo -n "Running..." -time -f "%E total, %U user, %S sys" ./cll1-print > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./cll1-print > /dev/null echo cat printf.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 printf.c -o printf +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 printf.c -o printf echo -n "Running..." -time -f "%E total, %U user, %S sys" ./printf > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./printf > /dev/null echo cat puts.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 puts.c -o puts +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 puts.c -o puts echo -n "Running..." -time -f "%E total, %U user, %S sys" ./puts > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./puts > /dev/null echo - -cat fputs.c -echo -n "Compiling..." -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" ./fputs > /dev/null diff --git a/demos/performance/test-performance2.sh b/demos/performance/test-performance2.sh index f4a33ad..b75ce5c 100755 --- a/demos/performance/test-performance2.sh +++ b/demos/performance/test-performance2.sh @@ -2,53 +2,60 @@ cat print2.rb echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print2.rb > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print2.rb > /dev/null echo cat print2.py echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print2.py > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print2.py > /dev/null echo cat xrange2.py echo -n "Running..." -time -f "%E total, %U user, %S sys" ./xrange2.py > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./xrange2.py > /dev/null echo cat echo2.php echo -n "Running..." -time -f "%E total, %U user, %S sys" ./echo2.php > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./echo2.php > /dev/null +echo + +cat write2.c +echo -n "Compiling..." +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 write2.c -o write2 +echo -n "Running..." +time -f "%E total, %U user, %S sys, %O outputs" ./write2 > /dev/null echo cat cout2.cpp echo -n "Compiling..." -time -f "%E total, %U user, %S sys" g++ -O2 cout2.cpp -o cout2 +time -f "%E total, %U user, %S sys, %O outputs" g++ -O2 cout2.cpp -o cout2 echo -n "Running..." -time -f "%E total, %U user, %S sys" ./cout2 > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./cout2 > /dev/null echo cat print2.pl echo -n "Running..." -time -f "%E total, %U user, %S sys" ./print2.pl > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./print2.pl > /dev/null echo cat printf2.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 printf2.c -o printf2 +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 printf2.c -o printf2 echo -n "Running..." -time -f "%E total, %U user, %S sys" ./printf2 > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./printf2 > /dev/null echo cat cll1-print2.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 cll1-print2.c -o cll1-print2 +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 cll1-print2.c -o cll1-print2 echo -n "Running..." -time -f "%E total, %U user, %S sys" ./cll1-print2 > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./cll1-print2 > /dev/null echo cat fputs2.c echo -n "Compiling..." -time -f "%E total, %U user, %S sys" gcc -O2 fputs2.c -o fputs2 +time -f "%E total, %U user, %S sys, %O outputs" gcc -O2 fputs2.c -o fputs2 echo -n "Running..." -time -f "%E total, %U user, %S sys" ./fputs2 > /dev/null +time -f "%E total, %U user, %S sys, %O outputs" ./fputs2 > /dev/null echo diff --git a/demos/performance/test-results b/demos/performance/test-results index 2ccb400..0f94f30 100644 --- a/demos/performance/test-results +++ b/demos/performance/test-results @@ -1,21 +1,21 @@ #!/usr/bin/ruby 10000000.times { print "stuff","\n" } -Running...0:16.66 total, 14.64 user, 1.70 sys +Running...0:16.24 total, 14.59 user, 1.63 sys, 0 outputs #!/usr/bin/python for i in range(1,10000000): print "stuff" -Running...0:09.24 total, 8.48 user, 0.15 sys +Running...0:08.79 total, 8.57 user, 0.14 sys, 0 outputs #!/usr/bin/python for i in xrange(1,10000000): print "stuff" -Running...0:08.31 total, 8.14 user, 0.01 sys +Running...0:08.34 total, 8.22 user, 0.01 sys, 0 outputs #!/usr/bin/php5 -q -Running...0:07.30 total, 4.92 user, 2.09 sys +Running...0:07.05 total, 4.83 user, 2.10 sys, 0 outputs +#include + +#define RUNS 10000000UL +int main (void) +{ + unsigned long i; + char *s1="stuff\n"; + int l1=strlen(s1); + +for (i=0;i @@ -47,8 +64,8 @@ int main() } return 0; } -Compiling...0:00.37 total, 0.33 user, 0.04 sys -Running...0:01.10 total, 1.05 user, 0.00 sys +Compiling...0:00.39 total, 0.34 user, 0.05 sys, 0 outputs +Running...0:01.02 total, 0.98 user, 0.01 sys, 0 outputs #include "cll1.h" @@ -57,8 +74,8 @@ program repeat(10000000) print("stuff"); } -Compiling...0:00.09 total, 0.08 user, 0.01 sys -Running...0:00.98 total, 0.91 user, 0.00 sys +Compiling...0:00.13 total, 0.12 user, 0.01 sys, 0 outputs +Running...0:01.25 total, 1.23 user, 0.00 sys, 0 outputs #include @@ -71,8 +88,8 @@ printf("stuff\n"); } return 0; } -Compiling...0:00.07 total, 0.06 user, 0.01 sys -Running...0:00.62 total, 0.62 user, 0.00 sys +Compiling...0:00.06 total, 0.04 user, 0.01 sys, 0 outputs +Running...0:00.62 total, 0.60 user, 0.00 sys, 0 outputs #include @@ -85,19 +102,6 @@ puts("stuff"); } return 0; } -Compiling...0:00.06 total, 0.04 user, 0.01 sys -Running...0:00.65 total, 0.62 user, 0.00 sys +Compiling...0:00.06 total, 0.05 user, 0.00 sys, 0 outputs +Running...0:00.63 total, 0.63 user, 0.00 sys, 0 outputs -#include - -#define RUNS 10000000UL -int main (void) -{ -unsigned long i; -for (i=0;i -Running...0:11.38 total, 9.38 user, 2.00 sys +Running...0:11.93 total, 9.84 user, 2.08 sys, 0 outputs + +#include +#include + +#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 @@ -37,8 +61,8 @@ int main() } return 0; } -Compiling...0:00.36 total, 0.32 user, 0.04 sys -Running...0:08.22 total, 6.07 user, 2.03 sys +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 #!/usr/bin/perl @@ -47,7 +71,7 @@ for ($i=0;$i<10000000;$i++) { print ("stuff1"," ","stuff2","\n"); } -Running...0:05.74 total, 5.73 user, 0.00 sys +Running...0:05.97 total, 5.96 user, 0.00 sys, 0 outputs #include @@ -60,8 +84,8 @@ int main (void) } return 0; } -Compiling...0:00.05 total, 0.02 user, 0.02 sys -Running...0:02.85 total, 2.84 user, 0.01 sys +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 #include "cll1.h" @@ -70,8 +94,8 @@ program repeat(10000000) print("stuff1","stuff2"); } -Compiling...0:00.09 total, 0.07 user, 0.02 sys -Running...0:01.94 total, 1.92 user, 0.01 sys +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 #include @@ -87,6 +111,6 @@ int main (void) } return 0; } -Compiling...0:00.14 total, 0.04 user, 0.01 sys -Running...0:01.56 total, 1.53 user, 0.01 sys +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 diff --git a/demos/performance/write.c b/demos/performance/write.c new file mode 100644 index 0000000..2f98790 --- /dev/null +++ b/demos/performance/write.c @@ -0,0 +1,15 @@ +#include + +#define RUNS 10000000UL +int main (void) +{ + unsigned long i; + char *s1="stuff\n"; + int l1=strlen(s1); + +for (i=0;i +#include + +#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