EDIT: Yields that there is already new PHP framework written as extension. http://code.google.com/p/yafphp, thanks gordon for mentioning this.
In short, do you think writing such framework as PHP extension worth and can be useful to the community ? Why ?
Motivation:
- When writing high performing web application (millions of daily page
views), the performance of front-end servers become important in
terms of how much hardware you need and how this hardware is
performing. - Many big web companies are implementing their own solutions to enhance PHP performance, by writing native frameworks or special PHP extensions for repetitive tasks.
- I am not aware of any well-known/well-written PHP framework or template engine written as PHP extension.
Concerns
- In many cases code written in PHP user space is only about 10-30% of the web application. All back-end is web services in Java/C/C++ and the front-end are only rendering the data and print it.
- The web-shift into writing single-webpage-architecture, Javascript MVC and templating in the client-side (Javascript).
- NodeJS as new faster stack than Apache/PHP stack.
- Ease-of use and installation. It is easier to use and understand the internals of a framework written in PHP as you can look at its code and learn.
- Ease-of maintainability, bigger community for framework written in PHP over a one written in C
- An already existing big community using other frameworks such as Zend/Cake/Symfony, etc. they may not be interested to start learning a new one.
Replacing any piece of PHP code with C will only help if you have proved that that PHP code is responsible for significant time-lag.
In apps that have to move millions of any sort of I/O, like web pages or files, what you need to do is keep the I/O hardware as busy as possible pumping the data.
That means minimizing the CPU turnaround time from the completion one I/O transaction to the start of the next.
So if you profile or randomly-pause it, ideally you should find all I/O threads in I/O-wait state nearly all the time.
If they are not, then whatever they are doing, it needs to be speeded up.
Don’t guess where they are.
Let the program tell you where they are, by diagnosis.