Overview
DooPHP a high-performance framework. It might be the fastest MVC based PHP framework in the world!
Most framework tries to be a platform full of unnecessary widgets/plugins and sometimes even think of replacing the designer role by generating frontend designs! DooPHP truly believe in the seperation of business logic and the user interface. Everyone has their own role in a team, and they shall do what they are most capable of.
With DooPHP, nothing is loaded except what is needed to build the page; no extra function calls, no extra class includes and no extra overhead. Which makes it the fastest framework in existence. But don't take our word for it, benchmark DooPHP on your own to find out the truth.
*The benchmark has been updated on 25 February, 2011. Details here. The previous benchmark here. If you wish to run the benchmark on your own, you can get the souce at GitHub.
The Test
To be fair, the comparison is done on the same machine, operating system, web server, and PHP FastCGI mode. 4 other popular php frameworks are chosen to compare with DooPHP. QeePHP, CodeIgniter and Yii are among the better performing frameworks known to PHP developers.
The frameworks tested are the latest by 25 February, 2011, CodeIgnitor 2.0, Yii 1.1.6 stable, CakePHP 1.3.7, CakePHP 2.0 dev, Symfony 2.0 sandbox, Kohana 3.1 and DooPHP 1.4.1
Since our goal is to compare the minimal overhead of each framework, the benchmark application for each framework should be the simplest one. We choose to display a "Hello World" text string by placing an echo statement in the default action of each application. Any additional framework features (e.g. database, caching, session) are disabled to ensure fairness of the comparison.
All tests are done without caching of data such as project settings, routes, environment mode. No disk cache or memory cache such as apc_store functions are used. It's plainly echo 'Hello World'; in the controller action.
APC extension is enabled for PHP and it's installed with the default configurations. Each framework is benchmarked 10 times and the average of the results is use as final. The RPS (requests per second) numbers were obtained using the ApacheBench tool with the command "ab -t 30 -c 10 URL" (i.e., at concurrency level 10 running the test for 30 seconds).
Perfomance Benchmark
The chart above shows how efficient DooPHP is when compared with other popular PHP frameworks. In the graph, RPS stands for "request per second" which describes how many requests an application written in a framework can process per second. The higher the number, the more efficient a framework is. As we can see that Doo outperforms all other frameworks in this comparison.
The performance advantage of Doo is especially significant when the widely used APC extension is enabled. APC is a type of op-code cache for PHP. You can still get good performance with the framework if your server doesn't have APC but installed other alternative like E-Accelerator, Zend Optimizer and XCache instead. Almost all shared hosting environment have these extensions installed as well.
Even without these op-code mechanism, DooPHP still runs blazing fast for your web application.
More than Just Hello World
Are you thinking that Hello World is a boring trick to benchmark a framework's performance? DooPHP agrees with you! Why not just benchmark some other features such as template engine and database ORM using the same hardware and environment? It should be lot of fun.
In this test, we compare the original DooPHP's Hello World benchmark with basic features of the framework. The 1st test outputs Hello World using the template engine to display the words. The 2nd test had database connection and models configured and setup. It executes a simple SELECT * FROM query to a table in the DB. The last test is aimed for production mode where configuration data are cached and Doo deploy.php is used. Doo's deploy.php is a combination of several classes that are core to Doo to reduce file inclusion.
Oh yes, the hardware and software details!
- Operating System: Ubuntu Server (Marverik) 64 bit
- Web Server: Nginx web server 0.7.67
- PHP: 5.3.5, with PHP-FPM, any non-essential extensions are disabled
- CPU: Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz - 64 bit processor
- Main Memory: 4GB DDR3 1066Mhz
- Hard Drive: 1TB 7200 RPM SATA II HDD
One of the benchmarked result:
ab -t30S -c10 http://localhost/doophp-1.4.1/app/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: nginx/0.7.67
Server Hostname: localhost
Server Port: 80
Document Path: /doophp-1.4.1/app/
Document Length: 11 bytes
Concurrency Level: 10
Time taken for tests: 6.438 seconds
Complete requests: 50000
Failed requests: 0
Write errors: 0
Total transferred: 8450000 bytes
HTML transferred: 550000 bytes
Requests per second: 7766.51 [#/sec] (mean)
Time per request: 1.288 [ms] (mean)
Time per request: 0.129 [ms] (mean, across all concurrent requests)
Transfer rate: 1281.78 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 1 1 0.4 1 10
Waiting: 0 1 0.4 1 10
Total: 1 1 0.4 1 10
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 2
90% 2
95% 2
98% 3
99% 3
100% 10 (longest request)