https://www.techempower.com/benchmarks/#section=data-r4
Framework Peak performance (higher is better) php 2,826
phalcon 786
Why performance drop a lot,just 1/4 php? bechmark source code : https://github.com/TechEmpower/FrameworkBenchmarks
|
Nov '14 |
3 |
5819 |
7 |
https://www.techempower.com/benchmarks/#section=data-r4
Framework Peak performance (higher is better) php 2,826
phalcon 786
Why performance drop a lot,just 1/4 php? bechmark source code : https://github.com/TechEmpower/FrameworkBenchmarks
I presume your post references the Peak database-access responses per second, EC2 large, single query benchmark.
It is very hard if not possible to make a framework that uses classes and OO design that is going to be faster than php itself. The object orientation alone will add a layer, which will make the framework slower than PHP itself. In addition, any framework that is written for php uses php itself, therefore the results are not surprising.
Whatever we have done is with performance in mind. The speed that Phalcon has is as fast as we can get it at. Still we are constantly researching ways to make it faster, so our journey is not done by a long mile :)
What you should be comparing is Phalcon against any other php framework. That shows where Phalcon's true power is.
Now if you don't want to use any object orientation, you will probably have the fastest application but you will have trouble maintaining it (one of the reasons why object oriented programming is preferred for applications).
Finally in the JSON serialization test (last one) you will see that Phalcon is more than twice as fast as any other framework, so its speed is there. However like I wrote above you can always use raw PHP to do the job.
I don't think using raw php is really a smart option, unless you're doing something very simple... We're using frameworks because we want to organize better our application, have a philosophy of work, reduce the development time, make use of patterns of design, make the code more testable, use OOP programming with all its benefits, use a common structure with a community, frameworks provide built-in security, reduce the number of bugs, have an elegant architecture, increase reusability of code, etc.
Using Raw-PHP is coming back to the old years where PHP was a mix of sql, html and php, making the application less maintainable, making undesirable to work in an application, leading to bugs hard to detect, opening the door to security problems, etc.
Regarding the benchmarks, It's sad to see how most of the PHP frameworks are always in the latest positions specially the most robust ones, only the very basic are getting good results. Some frameworks are using direct raw access to databases or a database gateway (micro orm), giving good/bad results, Phalcon is compared using a full ORM like Doctrine (in Symfony/Silex).
If you compare:
Database-Server: Mysql Object Relational Mapper (ORM) classification: Full
You'll see that Phalcon seems to be the fastest full ORM in the PHP world so far.
In defense of the PHP world, I could say that all PHP frameworks must be loaded in every request, run the test and unload all the resources allocated, in counter part, some of the frameworks/tools tested are the webserver themselves, which gives an advantage that PHP does not have.