📜 ⬆️ ⬇️

YAF - the fastest php framework *

Yaf is a PHP micro-framework that takes the structure of the Zend Framework application as a basis, but is written in C and is a PHP extension accessible via PECL .

The main (and only) task for writing it was the need to process requests as quickly as possible (comparable to php) in the MVC paradigm, but with the convenience provided by the Zend Framework.

Yaf and Zend Framework have similar APIs and a similar concept, while maintaining compatibility.
I generated a test application (zf create project test) and did a little synthetic performance test.

ZF MVC (for attracting attention)
')
The picture shows the standard query dispatching process in Yaf (ZF). It is clear that all this infrastructure requires overhead, and in the case of ZF (not processed by a file) considerable:

Average request processing time in ms

ab -n1000 1. ZF: Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 94 113 30.5 102 313 Waiting: 94 113 30.5 102 313 Total: 94 113 30.5 102 313 2. ZF + APC min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 36 40 6.2 39 111 Waiting: 36 40 6.2 39 111 Total: 36 40 6.2 39 111 3. YAF min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 1 2 0.8 2 15 Waiting: 1 2 0.8 2 15 Total: 2 2 0.8 2 15 4. PHP (html view) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 1 1 0.8 1 11 Waiting: 1 1 0.8 1 11 Total: 1 1 0.8 1 11 


It is clear that speed is not the main indicator for choosing a framework, but when you next decide to write facebook a small web application, be sure to pay attention to the MVC paradigm performed by YAF (ZF).

Have a good week everyone!

Source: https://habr.com/ru/post/128271/


All Articles