NogDog wrote:leatherback wrote:Jack McSlay wrote:By eliminating useless characters, it will decrease the size
of the files, resulting in a shorter parsing time.
Afaik know, this makes no noticeable difference. Anybody done any benchmarking
on this? I like to comment my code...
if you're in a situation where the
time it takes the PHP parser to skip over a comment is worth worrying about,
then you probably should be using compiled executable programs instead of
runtime parsed and compiled scripts.
Bytecode compiler. That would be smarter: eliminates the parsing step almost
completely, and allows the source to be as programmer-legible as possible (source code is primarily for the benefit of humans, after all. Without it we'd all be toggling machine code). An optimising bytecode compiler also offers advantages.
Generally, if it's not a busy part of the application, and/or it doesn't offer at least a half-order-of-magnitude performance gain then I've got better things to do with my time. If it takes me five minutes to speed a page up by ten nanoseconds then even if the page is being hit a thousand times a second around the clock it'll still take more than twenty years for the job to be worthwhile. Now if I could get a page that takes three seconds to load to load in half a second instead, and it takes half an hour to do the job ... at one page hit per second I'll be ahead within twelve hours.
That's time, not memory. But time is more important than memory. Memory's a cheap commodity, but time is a limited resource. (On a side note, php.ini's default maximum memory allocation used to be 8MB; now it's 128MB.)
bpat1434 wrote:and use LightTPD to handle all dynamic content
I've heard it the other way around: using Lighttpd as a static content server (I think because the computational grunt of Apache is better suited for the dynamic load). I'm willing to guess the choice of filesystem would also be significant at this level.