zendframework / zend-expressive-zendviewrenderer

zend-view PhpRenderer integration for Expressive
BSD 3-Clause "New" or "Revised" License
11 stars 12 forks source link

zend-view-(extra-)helpers performance overhead #25

Closed pine3ree closed 8 years ago

pine3ree commented 8 years ago

I just wanted to report that upgrading components in a small zend-expressive testing blog-like app caused a penalty in performance. I tried do downgrade and/or disable extra components (zend-i18n, zend-form) and I came to the conclusion that loading the view helpers caused a standard 10 blog post listing to more than double the processing time from 13~20 ms to 36~45 ms. In both cases disabling all the (extra) view helpers the app runs in about 6~12 ms. This in php-fpm 7.0.x. In php-fpm 5.5.x the timing is of course doubled, so i get about 70~80 ms which is comparable to a full zf(2.5) processing time.

The only way i could mitigate the problem was to add to the view_helpers config section only the plugins and aliases I needed instead of the whole zend-i18/zend-form configuration.

btw, I tested the plugin helpers using both v2 and v3 of plugin manager construct signature.

(the small test app uses a nzz setup: nikic-fastroute+zend-servicemanager+zend-view)

upgraded packages

zend-expressive-viewrenderer 1.0.1 => 1.1.0 zend-form 2.5.3 => 2.7.0 zend-stdlib 2.7.4 => 3.0.1 zend-servicemanager 2.7.4 => 3.0.1 zend-eventmanager 2.6.2 => 3.0.1 zend-form 2.6.0 => 2.8.3 zend-i18n 2.5.? => 2.7.2

... and other packages but they don'r seem related to the change in performance

kind regards. maks

pine3ree commented 8 years ago

fixed by: https://github.com/zendframework/zend-form/pull/77 https://github.com/zendframework/zend-i18n/pull/47