Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple stacks #35

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open

Multiple stacks #35

wants to merge 43 commits into from

Conversation

motin
Copy link

@motin motin commented Dec 9, 2015

Fixes #33 and includes fix for #34
Simplifies the fix for #8

Update: This PR also includes more robust results parsing, a php-based framework list, as well as fixes for #36 and #38 - all required to properly support multiple stacks.

@@ -8,7 +8,7 @@ class HelloController extends AppController

public function index()
{
$this->response->body('Hello World!');
$this->response->body('Hello World!' . require dirname(__FILE__).'/../../../libs/output_data.php');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't accept this change. It exclude shutdown process of the framework.

@motin
Copy link
Author

motin commented Dec 10, 2015

And why do you have to remove $_SERVER['DOCUMENT_ROOT']? I hope the code exactly the same for all frameworks.

The docker stacks are not served in the sub-directory php-framework-benchmark (since it does not make sense to do so when running fully dedicated stacks for the benchmarks), thus relying on the document root + a sub-directory is not working in both cases. Dirname + __FILE__ always works, but I can refactor to use an environment variable instead.

Regarding putting require libs/output_data.php in the actual controller method. I can't accept this change. It exclude shutdown process of the framework. And why do you need to echo?

Many frameworks required the response to be returned in the actual controller method and not echoed after the framework has been shutdown. To be able to return the value without using output buffering, I changed the printf to sprintf. This also makes it ready to benchmark event-driven frameworks such as http://reactphp.org/

I traced this back to #38
In the process, I also came across #36

@motin
Copy link
Author

motin commented Dec 10, 2015

The latest commits also fixes #36 and #38

@kenjis
Copy link
Owner

kenjis commented Dec 10, 2015

The docker stacks are not served in the sub-directory php-framework-benchmark (since it does not make sense to do so when running fully dedicated stacks for the benchmarks)

The docker stacks should have the same sub-directory. So you don't have to change the code only for the docker stacks.

list.php Outdated
'phalcon-1.3', // Not compiled for PHP7 - is it even supported?
'phalcon-2.0', // Not compiled for PHP7 - is it even supported?
'ice-1.0', // Not compiled for PHP7 - is it even supported?
'bear-1.0', // apc_fetch()-error on PHP7
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BEAR.Sunday should work fine on php7.

@motin
Copy link
Author

motin commented Dec 10, 2015

The docker stacks should have the same sub-directory. So you don't have to change the code only for the docker stacks.

Fixed and reversed the changed code.

@motin
Copy link
Author

motin commented Dec 10, 2015

Btw, interesting results already especially regarding HHVM: facebook/hhvm#6645

README.md Outdated
By sharing underlying software stacks, the benchmark results vary only according to the host machine's hardware specs and differing code implementations.

See [docker/README.md](docker/README.md)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this. I don't need it. I don't maintain the results of Docker.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not primarily for you :) It is for everyone that easily wants to run their own benchmarks. Instead of having to set-up several server environments, compile php extensions and configure their own server software to run all the different framework, they can instead simply install docker toolbox and be running within minutes.

I will remove the change from this PR in hope that you will consider this approach in the future: #41

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark results in Docker do not matter unless you or someone deploy using it.

Is your production environment Docker on Mac OS X? If not, the benchmark results might mislead you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My production environment is Docker in AWS instances and it is trivial to run the benchmarks as well when dealing with Docker stacks. Let's discuss in #41

@kenjis
Copy link
Owner

kenjis commented Dec 10, 2015

Why don't you move docker-results.sh and docker-urls.sh to docker/bin/?

@kenjis
Copy link
Owner

kenjis commented Dec 10, 2015

ab command is missing.

$ docker-compose run shell
root@889a4a34285c:/repo# sh setup.sh
ab command not found.

@motin
Copy link
Author

motin commented Dec 11, 2015

Why don't you move docker-results.sh and docker-urls.sh to docker/bin/?

Sure, now when there are three scripts it makes more sense. When there was only a single script, it felt odd to create a new bin-folder instead of re-using the existing one.

@motin
Copy link
Author

motin commented Dec 11, 2015

ab command is missing.

Weird, it is installed at https://github.com/motin/php-framework-benchmark/blob/e720dd142933fed0ffe3247bce6874fa5d900668/docker/stack/php/shell/Dockerfile#L3

I'll add docker-compose build shell to the readme so that there is no chance of it not being included.

@kenjis
Copy link
Owner

kenjis commented Dec 11, 2015

Weird, it is installed at https://github.com/motin/php-framework-benchmark/blob/e720dd142933fed0ffe3247bce6874fa5d900668/docker/stack/php/shell/Dockerfile#L3

You're right. I don't know why. I did according to your README.
I'll try it again later.

@o5 o5 mentioned this pull request Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enh: php56 vs php70 graphs/tables
2 participants