does statically compiling php pecl extensions (inside binary vs. extension=ext.so) improve performance?
does compiling pecl extensions inside the php binary improve performance?
i hope my terminology is right, but:
http://php.net/manual/en/install.pecl.static.php
that开发者_运维技巧s what i mean.
we have a small set of extensions that are used in pretty much every script execution and were thinking it would just be wiser to have them inside the mod_php binary rather then loaded via extension=ext.so @ php.d / php.ini. further more we do use a self-compiled php binary rather then a package (rpm/dpg/etc) based one. so doing this would be fairly trivial.
anyone?
thanks!
No.
Even for old fashioned CGI, I'd expect that the dynamically linked version would be very slightly faster - assuming that you've got a continuous stream of requests - new instances of the interpreter would get COWed. The only time the statically linked approach would be faster (and then its just reducing latency) would be if there are no instances in memory.
OTOH for fastCGI / module, the code just forks - it never goes out of memory.
But, regardless, the difference would be so small its not worth considering (switching away from CGI would give massively more performance improvements)
精彩评论