From ba41861f8912ff0c31924d7f76afbafe79758183 Mon Sep 17 00:00:00 2001 From: xchaos Date: Tue, 22 Jan 2008 16:33:41 +0000 Subject: [PATCH] PHP bechmarks added git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@32 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- demos/performance/echo.php | 7 +++ demos/performance/echo2.php | 7 +++ demos/performance/test-performance.sh | 12 +++-- demos/performance/test-performance2.sh | 4 ++ demos/performance/test-results | 68 +++++++++++++++----------- demos/performance/test-results2 | 42 ++++++++++------ 6 files changed, 91 insertions(+), 49 deletions(-) create mode 100755 demos/performance/echo.php create mode 100755 demos/performance/echo2.php diff --git a/demos/performance/echo.php b/demos/performance/echo.php new file mode 100755 index 0000000..39b6a2b --- /dev/null +++ b/demos/performance/echo.php @@ -0,0 +1,7 @@ +#!/usr/bin/php5 -q + diff --git a/demos/performance/echo2.php b/demos/performance/echo2.php new file mode 100755 index 0000000..dd4c337 --- /dev/null +++ b/demos/performance/echo2.php @@ -0,0 +1,7 @@ +#!/usr/bin/php5 -q + diff --git a/demos/performance/test-performance.sh b/demos/performance/test-performance.sh index be50320..7c9af2f 100755 --- a/demos/performance/test-performance.sh +++ b/demos/performance/test-performance.sh @@ -8,16 +8,20 @@ cat print.py echo "Running..." time ./print.py > /dev/null -cat cout.cpp -echo "Compiling..." -time g++ -O2 cout.cpp -o cout +cat echo.php echo "Running..." -time ./cout > /dev/null +time ./echo.php > /dev/null cat print.pl echo "Running..." time ./print.pl > /dev/null +cat cout.cpp +echo "Compiling..." +time g++ -O2 cout.cpp -o cout +echo "Running..." +time ./cout > /dev/null + cat cll1-print.c echo "Compiling..." time gcc -O2 cll1-print.c -o cll1-print diff --git a/demos/performance/test-performance2.sh b/demos/performance/test-performance2.sh index 4b5e951..46e4a1d 100755 --- a/demos/performance/test-performance2.sh +++ b/demos/performance/test-performance2.sh @@ -8,6 +8,10 @@ cat print2.py echo "Running..." time ./print2.py > /dev/null +cat echo2.php +echo "Running..." +time ./echo2.php > /dev/null + cat cout2.cpp echo "Compiling..." time g++ -O2 cout2.cpp -o cout2 diff --git a/demos/performance/test-results b/demos/performance/test-results index 48f6b2b..72f50a6 100644 --- a/demos/performance/test-results +++ b/demos/performance/test-results @@ -2,7 +2,7 @@ 10000000.times { print "stuff","\n" } Running... -14.49user 1.56system 0:16.15elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +14.58user 1.54system 0:16.27elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+457minor)pagefaults 0swaps #!/usr/bin/python @@ -10,8 +10,29 @@ for i in range(1,10000000): print "stuff" Running... -8.43user 0.19system 0:08.71elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+39996minor)pagefaults 0swaps +8.28user 0.15system 0:08.61elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+39997minor)pagefaults 0swaps +#!/usr/bin/php5 -q + +Running... +4.93user 2.01system 0:07.24elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+1282minor)pagefaults 0swaps +#!/usr/bin/perl + +my $i=0; +for ($i=0;$i<10000000;$i++) +{ + print ("stuff"); +} + +Running... +2.56user 0.00system 0:02.73elapsed 93%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+425minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -24,22 +45,11 @@ int main() return 0; } Compiling... -0.32user 0.04system 0:00.37elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0.34user 0.03system 0:00.38elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+8690minor)pagefaults 0swaps Running... -1.01user 0.00system 0:01.02elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+239minor)pagefaults 0swaps -#!/usr/bin/perl - -my $i=0; -for ($i=0;$i<10000000;$i++) -{ - print ("stuff"); -} - -Running... -2.52user 0.00system 0:02.53elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+425minor)pagefaults 0swaps +1.01user 0.00system 0:01.03elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+238minor)pagefaults 0swaps #include "cll1.h" program @@ -48,10 +58,10 @@ program print("stuff"); } Compiling... -0.08user 0.01system 0:00.09elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+4001minor)pagefaults 0swaps +0.09user 0.00system 0:00.09elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3999minor)pagefaults 0swaps Running... -0.88user 0.00system 0:00.90elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k +0.84user 0.01system 0:00.93elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+131minor)pagefaults 0swaps #include @@ -65,11 +75,11 @@ printf("stuff\n"); return 0; } Compiling... -0.05user 0.00system 0:00.06elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3781minor)pagefaults 0swaps +0.06user 0.00system 0:00.06elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3780minor)pagefaults 0swaps Running... 0.61user 0.00system 0:00.62elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+114minor)pagefaults 0swaps +0inputs+0outputs (0major+115minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -82,11 +92,11 @@ puts("stuff"); return 0; } Compiling... -0.05user 0.00system 0:00.06elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3779minor)pagefaults 0swaps +0.03user 0.02system 0:00.06elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3778minor)pagefaults 0swaps Running... 0.62user 0.00system 0:00.63elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+115minor)pagefaults 0swaps +0inputs+0outputs (0major+114minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -99,8 +109,8 @@ fputs("stuff\n",stdout); return 0; } Compiling... -0.05user 0.01system 0:00.06elapsed 103%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3784minor)pagefaults 0swaps +0.04user 0.01system 0:00.06elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3787minor)pagefaults 0swaps Running... -0.56user 0.00system 0:00.56elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0.56user 0.00system 0:00.56elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+115minor)pagefaults 0swaps diff --git a/demos/performance/test-results2 b/demos/performance/test-results2 index bf73127..60ef067 100644 --- a/demos/performance/test-results2 +++ b/demos/performance/test-results2 @@ -2,16 +2,26 @@ 10000000.times { print "stuff1"," ","stuff2","\n" } Running... -22.69user 1.50system 0:24.43elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+456minor)pagefaults 0swaps +23.14user 1.62system 0:25.61elapsed 96%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.56user 0.17system 0:13.77elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+39997minor)pagefaults 0swaps +13.50user 0.18system 0:13.83elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+39996minor)pagefaults 0swaps +#!/usr/bin/php5 -q + +Running... +9.87user 2.20system 0:12.37elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+1282minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -24,10 +34,10 @@ int main() return 0; } Compiling... -0.33user 0.03system 0:00.37elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0.35user 0.04system 0:00.40elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+8699minor)pagefaults 0swaps Running... -6.16user 1.93system 0:08.11elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +6.22user 1.82system 0:08.07elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+241minor)pagefaults 0swaps #!/usr/bin/perl @@ -37,7 +47,7 @@ for ($i=0;$i<10000000;$i++) print ("stuff1"," ","stuff2","\n"); } Running... -5.68user 0.00system 0:05.71elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +5.74user 0.01system 0:05.93elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+425minor)pagefaults 0swaps #include "cll1.h" @@ -47,11 +57,11 @@ program print("stuff1","stuff2"); } Compiling... -0.08user 0.01system 0:00.10elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +0.08user 0.01system 0:00.09elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+4000minor)pagefaults 0swaps Running... -1.91user 0.00system 0:01.94elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+132minor)pagefaults 0swaps +1.92user 0.01system 0:01.94elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+131minor)pagefaults 0swaps #include #define RUNS 10000000UL @@ -64,10 +74,10 @@ int main (void) return 0; } Compiling... -0.03user 0.02system 0:00.06elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3783minor)pagefaults 0swaps +0.04user 0.02system 0:00.06elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3781minor)pagefaults 0swaps Running... -2.90user 0.00system 0:02.89elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k +2.89user 0.01system 0:02.92elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+121minor)pagefaults 0swaps #include @@ -84,8 +94,8 @@ int main (void) return 0; } Compiling... -0.04user 0.02system 0:00.06elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k -0inputs+0outputs (0major+3787minor)pagefaults 0swaps +0.04user 0.02system 0:00.06elapsed 104%CPU (0avgtext+0avgdata 0maxresident)k +0inputs+0outputs (0major+3788minor)pagefaults 0swaps Running... -1.52user 0.00system 0:01.54elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k +1.50user 0.00system 0:01.51elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+115minor)pagefaults 0swaps -- 2.30.2