2

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:

  1. 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.
  2. Many big web companies are implementing their own solutions to enhance PHP performance, by writing native frameworks or special PHP extensions for repetitive tasks.
  3. I am not aware of any well-known/well-written PHP framework or template engine written as PHP extension.

Concerns

  1. 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.
  2. The web-shift into writing single-webpage-architecture, Javascript MVC and templating in the client-side (Javascript).
  3. NodeJS as new faster stack than Apache/PHP stack.
  4. 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.
  5. Ease-of maintainability, bigger community for framework written in PHP over a one written in C
  6. 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.
Laith Shadeed
  • 4,271
  • 2
  • 23
  • 27
  • 1
    has been done before: http://docs.php.net/manual/en/book.yaf.php. In addition to this, the [PS/FI group is thinking about creating common interfaces for certain components](http://blog.astrumfutura.com/2011/10/interfacing-the-php-world-would-be-good/). Whether that is a good idea is not a good fit for SO. – Gordon Nov 11 '11 at 14:19
  • oh, this is the first time I see this. Seems very new. I need to give it a try to benchmark. Thank you. – Laith Shadeed Nov 11 '11 at 14:26
  • No because there is a well-known/well-written PHP framework: http://framework.zend.com/ (you can do everything with it!) – noob Nov 11 '11 at 14:27

1 Answers1

1

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.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135