From: xchaos Date: Tue, 22 Jan 2008 14:38:44 +0000 (+0000) Subject: C and C++ compiled with -O2 (there is no -O4 in GCC :-) X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=bd245bd28cfdcb642e2b341aef366e020b7034d7;p=svn%2FCll1h%2F.git C and C++ compiled with -O2 (there is no -O4 in GCC :-) git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@30 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- diff --git a/demos/performance/test-performance.sh b/demos/performance/test-performance.sh index 31bb47d..be50320 100755 --- a/demos/performance/test-performance.sh +++ b/demos/performance/test-performance.sh @@ -10,7 +10,7 @@ time ./print.py > /dev/null cat cout.cpp echo "Compiling..." -time g++ -O4 cout.cpp -o cout +time g++ -O2 cout.cpp -o cout echo "Running..." time ./cout > /dev/null @@ -20,24 +20,24 @@ time ./print.pl > /dev/null cat cll1-print.c echo "Compiling..." -time gcc -O4 cll1-print.c -o cll1-print +time gcc -O2 cll1-print.c -o cll1-print echo "Running..." time ./cll1-print > /dev/null cat printf.c echo "Compiling..." -time gcc -O4 printf.c -o printf +time gcc -O2 printf.c -o printf echo "Running..." time ./printf > /dev/null cat puts.c echo "Compiling..." -time gcc -O4 puts.c -o puts +time gcc -O2 puts.c -o puts echo "Running..." time ./puts > /dev/null cat fputs.c echo "Compiling..." -time gcc -O4 fputs.c -o fputs +time gcc -O2 fputs.c -o fputs echo "Running..." time ./fputs > /dev/null diff --git a/demos/performance/test-performance2.sh b/demos/performance/test-performance2.sh index 7298303..4b5e951 100755 --- a/demos/performance/test-performance2.sh +++ b/demos/performance/test-performance2.sh @@ -10,7 +10,7 @@ time ./print2.py > /dev/null cat cout2.cpp echo "Compiling..." -time g++ -O4 cout2.cpp -o cout2 +time g++ -O2 cout2.cpp -o cout2 echo "Running..." time ./cout2 > /dev/null @@ -20,18 +20,18 @@ time ./print2.pl > /dev/null cat cll1-print2.c echo "Compiling..." -time gcc -O4 cll1-print2.c -o cll1-print2 +time gcc -O2 cll1-print2.c -o cll1-print2 echo "Running..." time ./cll1-print2 > /dev/null cat printf2.c echo "Compiling..." -time gcc -O4 printf2.c -o printf2 +time gcc -O2 printf2.c -o printf2 echo "Running..." time ./printf2 > /dev/null cat fputs2.c echo "Compiling..." -time gcc -O4 fputs2.c -o fputs2 +time gcc -O2 fputs2.c -o fputs2 echo "Running..." time ./fputs2 > /dev/null diff --git a/demos/performance/test-results b/demos/performance/test-results index 6b5e60a..9659e79 100644 --- a/demos/performance/test-results +++ b/demos/performance/test-results @@ -2,15 +2,15 @@ 10000000.times { print "stuff","\n" } Running... -14.60user 1.64system 0:16.50elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+457minor)pagefaults 0swaps +14.52user 1.60system 0:16.15elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+456minor)pagefaults 0swaps #!/usr/bin/python for i in range(1,10000000): print "stuff" Running... -8.48user 0.17system 0:08.75elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +8.61user 0.16system 0:08.78elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+39997minor)pagefaults 0swaps #include @@ -24,11 +24,11 @@ int main() return 0; } Compiling... -0.33user 0.04system 0:00.38elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+8821minor)pagefaults 0swaps +0.34user 0.02system 0:00.36elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+8698minor)pagefaults 0swaps Running... -3.71user 2.04system 0:05.82elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+240minor)pagefaults 0swaps +3.81user 1.90system 0:05.72elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+241minor)pagefaults 0swaps #!/usr/bin/perl my $i=0; @@ -38,7 +38,7 @@ for ($i=0;$i<10000000;$i++) } Running... -2.52user 0.00system 0:02.53elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +2.51user 0.00system 0:02.51elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+424minor)pagefaults 0swaps #include "cll1.h" @@ -48,10 +48,10 @@ program print("stuff"); } Compiling... -0.08user 0.01system 0:00.09elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+4014minor)pagefaults 0swaps +0.08user 0.01system 0:00.09elapsed 103%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3999minor)pagefaults 0swaps Running... -0.84user 0.00system 0:00.85elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0.88user 0.00system 0:00.89elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+130minor)pagefaults 0swaps #include @@ -65,11 +65,11 @@ printf("stuff\n"); return 0; } Compiling... -0.04user 0.02system 0:00.05elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k +0.04user 0.01system 0:00.05elapsed 94%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+3781minor)pagefaults 0swaps Running... -0.62user 0.00system 0:00.63elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+114minor)pagefaults 0swaps +0.62user 0.00system 0:00.61elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+116minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -82,10 +82,10 @@ puts("stuff"); return 0; } Compiling... -0.04user 0.01system 0:00.06elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3779minor)pagefaults 0swaps +0.05user 0.00system 0:00.05elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3781minor)pagefaults 0swaps Running... -0.62user 0.01system 0:00.63elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0.60user 0.00system 0:00.61elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+115minor)pagefaults 0swaps #include @@ -99,8 +99,8 @@ fputs("stuff\n",stdout); return 0; } Compiling... -0.05user 0.00system 0:00.19elapsed 33%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3787minor)pagefaults 0swaps +0.05user 0.00system 0:00.06elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3785minor)pagefaults 0swaps Running... -0.57user 0.00system 0:00.57elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+115minor)pagefaults 0swaps +0.56user 0.00system 0:00.57elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+114minor)pagefaults 0swaps diff --git a/demos/performance/test-results2 b/demos/performance/test-results2 index 3ce1fe8..17a86f3 100644 --- a/demos/performance/test-results2 +++ b/demos/performance/test-results2 @@ -2,16 +2,16 @@ 10000000.times { print "stuff1"," ","stuff2","\n" } Running... -22.60user 1.51system 0:24.13elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+456minor)pagefaults 0swaps +23.37user 1.62system 0:25.02elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+457minor)pagefaults 0swaps #!/usr/bin/python for i in range(1,10000000): print "stuff1","stuff2" Running... -13.40user 0.16system 0:13.56elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+39997minor)pagefaults 0swaps +13.56user 0.17system 0:13.76elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+39996minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -24,11 +24,11 @@ int main() return 0; } Compiling... -0.32user 0.04system 0:00.37elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+8824minor)pagefaults 0swaps +0.32user 0.04system 0:00.37elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+8700minor)pagefaults 0swaps Running... -6.41user 1.94system 0:08.37elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+241minor)pagefaults 0swaps +5.93user 2.16system 0:08.10elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+240minor)pagefaults 0swaps #!/usr/bin/perl my $i=0; @@ -37,7 +37,7 @@ for ($i=0;$i<10000000;$i++) print ("stuff1"," ","stuff2","\n"); } Running... -5.66user 0.00system 0:05.67elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +5.68user 0.00system 0:05.68elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+425minor)pagefaults 0swaps #include "cll1.h" @@ -47,11 +47,11 @@ program print("stuff1","stuff2"); } Compiling... -0.07user 0.02system 0:00.10elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+4010minor)pagefaults 0swaps +0.08user 0.01system 0:00.09elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3999minor)pagefaults 0swaps Running... -1.82user 0.00system 0:01.82elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+130minor)pagefaults 0swaps +1.90user 0.00system 0:01.90elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+132minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -64,10 +64,10 @@ int main (void) return 0; } Compiling... -0.04user 0.02system 0:00.05elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3783minor)pagefaults 0swaps +0.04user 0.02system 0:00.06elapsed 104%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3784minor)pagefaults 0swaps Running... -2.84user 0.00system 0:02.85elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +2.87user 0.00system 0:02.88elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+122minor)pagefaults 0swaps #include @@ -84,8 +84,8 @@ int main (void) return 0; } Compiling... -0.05user 0.00system 0:00.06elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0.05user 0.01system 0:00.12elapsed 52%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+3790minor)pagefaults 0swaps Running... -1.54user 0.00system 0:01.54elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+115minor)pagefaults 0swaps +1.50user 0.01system 0:01.51elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+116minor)pagefaults 0swaps