3 ms·
It has it's positives and negatives. If you tell a room full of Java and C++ developers with no experience to PHP, that on every request, everything gets loade
by MAGZine 13y ago
It has it's positives and negatives.
If you tell a room full of Java and C++ developers with no experience to PHP, that on every request, everything gets loaded, and at the end of the request, everything (and I mean everything) gets torn down, you'll get a bunch of blank stares.
However, the web, in its nature, is stateless. So, having a language where nothing persists across requests (except that which you store/retreive by using cookies/session data) is suited to the web. Also, not having to worry about memory management or thread-spawning helped to make PHP the simple, accessible language that it is. No memory leaks!* ;-)
In loadtesting, I've found that PHP is almost always CPU bound. Yeah, you might be loading and unloading 60MB of memory each time, but a) caching (send those 304s!) and b) it's not like your memory is going to 'go bad' from loading/unloading Symfony.
That said, there might be something to keeping Symfony loaded in memory. In my own tests, loading the classmap is one of the longest-running tasks in simpler PHP applications.