kenjis / php-framework-benchmark

PHP Framework Benchmark
1.03k stars 204 forks source link

Added zf-1.12 #69

Closed seyfer closed 7 years ago

axot commented 7 years ago
$ bash setup.sh zf-1.12/
***** zf-1.12 *****
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Generating optimized autoload files
Creating project at /var/www/php-framework-benchmark/zf-1.12/helloworld
Note: This command created a web project, for more information setting up your VHOST, please see docs/README

Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/php-framework-benchmark/zf-1.12/library/Zend/Test/PHPUnit/ControllerTestCase.php on line 48

Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /var/www/php-framework-benchmark/zf-1.12/library/Zend/Test/PHPUnit/ControllerTestCase.php on line 48
rm: cannot remove ‘./zf-1.12/helloworld/public/.htaccess’: Permission denied

@seyfer how to solve this?

seyfer commented 7 years ago

@axot, I will try to reproduce the error and resolve it.

seyfer commented 7 years ago

@kenjis @axot please check it now

axot commented 7 years ago

@seyfer almost work!

$ bash setup.sh zf-1.12/
***** zf-1.12 *****
Loading composer repositories with package information
Installing dependencies from lock file
  - Installing zendframework/zendframework1 (1.12.20)
    Downloading: 100%

Generating optimized autoload files
rm: cannot remove ‘./zf-1.12/helloworld/public/.htaccess’: Permission denied

Is this a permission issue?

$ bash benchmark.sh zf-1.12/ zf-2.4/ zf-2.5 laravel-5.2
zf-1.12
ab -c 10 -t 3 http://127.0.0.1/php-framework-benchmark/zf-1.12/public/
Completed 5000 requests
Finished 6047 requests
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0   4852      0 --:--:-- --:--:-- --:--:--  6000

zf-2.4
ab -c 10 -t 3 http://127.0.0.1/php-framework-benchmark/zf-2.4/public/index.php/application/hello/index
Finished 1903 requests
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    34  100    34    0     0   4575      0 --:--:-- --:--:-- --:--:--  4857

zf-2.5
ab -c 10 -t 3 http://127.0.0.1/php-framework-benchmark/zf-2.5/public/index.php/application/hello/index
Finished 1882 requests
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    34  100    34    0     0   2822      0 --:--:-- --:--:-- --:--:--  3090

laravel-5.2
ab -c 10 -t 3 http://127.0.0.1/php-framework-benchmark/laravel-5.2/public/index.php/hello/index
Finished 2532 requests
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    33  100    33    0     0   6353      0 --:--:-- --:--:-- --:--:--  6600

|framework          |requests per second|relative|peak memory|relative|
|-------------------|------------------:|-------:|----------:|-------:|
|zf-1.12            |           2,015.64|     3.2|       0.00|     0.0|
|zf-2.4             |             634.23|     1.0|       2.51|     0.0|
|zf-2.5             |             627.22|     1.0|       2.64|     0.0|
|laravel-5.2        |             843.98|     1.3|       2.38|     0.0|

Peak memory shows zero. Does this result correct?

kenjis commented 7 years ago

It seems there is no Hello controller. And you must add the below line in the end of index.php:

require $_SERVER['DOCUMENT_ROOT'].'/php-framework-benchmark/libs/output_data.php';
axot commented 7 years ago

@kenjis After add out_data.php it works now. Thank you.

|framework          |requests per second|relative|peak memory|relative|
|-------------------|------------------:|-------:|----------:|-------:|
|zf-1.12            |           1,972.90|     3.1|       1.27|     4.3|
|zf-2.4             |             638.95|     1.0|       2.51|     8.6|
|zf-2.5             |             630.90|     1.0|       2.64|     9.0|
|kumbia-1.0-dev     |           8,463.88|    13.4|       0.29|     1.0|
|tipsy-0.10         |           6,199.86|     9.8|       0.33|     1.1|
|symfony-2.7        |           1,060.05|     1.7|       2.85|     9.7|
|symfony-3.0        |             790.74|     1.3|       3.14|    10.7|
kenjis commented 7 years ago

http://127.0.0.1/php-framework-benchmark/zf-1.12/public/ is not good URL. All other frameworks specify the Hello controller. Please change the URL like http://127.0.0.1/php-framework-benchmark/zf-1.12/public/index.php/application/hello/index

seyfer commented 7 years ago

http://127.0.0.1/php-framework-benchmark/zf-1.12/public/index.php/application/hello/index

I don't know how to do it. Passing parameters through index.php doesn't work for me with zf-3 and with zf-1 too. Even with right routing config. But it worked when project was separated in own vhost.

seyfer commented 7 years ago

@kenjis, Why I can't output Hello World! in default index controller? I did it and @axot even got results.

I did the same for zf-3.

seyfer commented 7 years ago

@kenjis please show your nginx default vhost config. maybe it's something wrong with mine. i will try to fix it with right config then

Now I have

404 Not Found nginx/1.10.0 (Ubuntu)

if I add something like index.php/application/hello/index

kenjis commented 7 years ago

@seyfer I use Apache.

kenjis commented 7 years ago

@seyfer @axot

I fixed a bit this PR and merged into master branch.

framework requests per second relative peak memory relative
zf-1.12 284.31 4.7 1.27 1.0
zf-2.5 61.13 1.0 2.96 2.3
zf-3.0 163.44 2.7 1.93 1.5
laravel-5.2 115.80 1.9 2.40 1.9
kenjis commented 7 years ago

@seyfer @axot If there is something wrong with zf1 in master branch, feel free to send another PR.

seyfer commented 7 years ago

@kenjis , thank you.