Re: echo or print ?

From: Date: Sat, 21 Apr 2007 23:07:37 +0000
Subject: Re: echo or print ?
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-253454@lists.php.net to get a copy of this message
Tijnema ! wrote:
On 4/22/07, Stut <stuttle@gmail.com> wrote:
Tijnema ! wrote:
But what else would you use a lot in your code? all commonly used things (like while, if, echo, etc) are just (nearly) as fast as their alternatives (for, print, etc). Other functions (like file/stream) might be some performance difference, but you probably use this only a few times in your script. So there's not a bigger performance difference then when optimizing echo/print.
Get your head out of the details. Try file-based caching against DB access.
And compare that with RAM caching ;)
Or SQL query optimisation. Or even server configuration tuning. All these things and others on the same level are far more worthy of your time. -Stut
So, optimizing is useless :P I see no point in doing it, even more when it's only for personal usage. The time used for writing optimized code is probably far more then the time you save by running optimized code. :)
I hope that smiley means you're joking. Optimising is not useless, and I've never said it is. However, you have to do so where it's going to have the biggest impact. What I'm basically saying is you should be optimising logic before even thinking about whether you're using the most optimised functions. Are you sure that your code doesn't do anything it doesn't need to? Do you do a whole load of initialisation for each request that could be cached in some way? Is every part of that initialisation needed for every page request, or should it be doing different things on different pages. IMHO, the kind of developer that gets hung up on details like echo or print is one that is unlikely to accomplish a lot in any given day. -Stut

« previous php.general (#253454) next »