Re: [PEPr] Comment on PHP::PHP_Callback

From: Date: Fri, 04 May 2007 16:21:48 +0000
Subject: Re: [PEPr] Comment on PHP::PHP_Callback
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-46602@lists.php.net to get a copy of this message
On 5/4/07, Joe Stump <joe@joestump.net> wrote:
Obviously, you don't know what you are talking about. It just takes common sense to know beforehand this is going to be slow. Hrm. I don't know what I'm talking about? Of the last three major sites I've worked on they include Care2.com (40m+ page views a month and 6m+ registered users), Enotes.com (15m+ page views a month) and Digg.com (Top 100 site on the net, 1m+ registered users). So, please, educate yourself before you say that I obviously am an idiot. Now, I'll explain myself a bit more. PHP cycles are, in fact, the easiest part of your architecture to scale. File storage is difficult, but possible and DB traffic is a huge PITA to scale. Obviously, his package takes more cycles to run, I wasn't arguing that. The point I was making is that PHP cycles are usually the very last thing that a large site worries about. I could give two shits less about 5 extra PHP calls in my code. Now, 5 extra DB calls are an entirely different story.
I think we're getting into the realm of the C hacker here and I'd like people to take a step back. Joe's point is very well made. Remember the fallacy of Premature Optimization. It is always best to write code in a maintainable and usable way and *then* profile and optimize. If there are code and packages that make your life as a coder simpler, use them. Remember also the rule "Computer time is cheaper than coder time". Not only is trying to keep this package out of PEAR due to "too many cycles" case of extreme premature optimization (optimizing code you haven't written yet by limiting the tools you can use) but it is also against the grain of what PEAR is. If we were worried, at the bottom level, about CPU time we wouldn't have or use PEAR at all. PEAR has packages which abstract and make your life easier as a coder. They *do* and *will* slow down your code. Period. You can always write faster code by loading one small, optimized file which does only exactly what you need. It is important to remember that unless the code/algorithm is written horribly the CPU time is not what you should be worried about in almost all cases. I/O is almost always the biggest slow-down in an application. Reducing CPU time is far less important than reducing I/O. If your I/O is omtimized then you profile your code and find ways to reduce CPU. Not using PHP_Callback is not likely to be one of your big offenders. This package looks like it solves a real problem in a unique and elegant way. I would be for including this package in PEAR. -- Justin Patrin

« previous php.pear.dev (#46602) next »