YAF - the fastest php framework *

    Yaf is a PHP micro-framework based on the structure of the Zend Framework application, but written in C and is a PHP extension available through PECL .

    The main (and only) task for writing it was the need for the fastest (comparable to php) query processing in the MVC paradigm but with the convenience provided by the Zend Framework.

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

    ZF MVC (to attract attention)

    The picture shows the standard dispatch 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, the next time you decide to write facebook a small web application, be sure to pay attention to the MVC paradigm performed by YAF (ZF).

    Have a nice week!

    Also popular now: