Sorry if I caused confusion with the comparison, it was with both print and quotes, 
vs echos and singles.  The largest difference being echos.

  I know that large optimizations have been done with string parsing in PHP4.  My 
quick test with PHP3 (most being prior to 3.0.9) was that there was a significant 
difference, but like Leon said earlier, optimization is a tricky thing.

  echo is a statement (with no return value) and not a function like print().  Last 
time I looked at the source, this was a fairly large difference.  Of course the 
function-call overhead is a given.  I haven't had the leisure to check the PHP4/Zend 
source, but it's quite quicker in tests I've ran.

  The only way to tell is to test your actual platform.  But again like Leon said, you 
can optimize the wrong pieces very easily.  I agree totally that the programmers' time 
is more important, but hey, I'm a programmer.

>> Leon, if you are reading this, what do you think of integrating some the
>> ideas into FT 2?
>> Are you using single-quotes in FT2? If not, I suggest we divide up the
>> modules and each do some editing.

  I really wouldn't recommend anything this drastic concerning quoting (see above).

  As an example case, I recently tested the latest version FastTemplate class vs my 
modifications of print-to-echo and quoting.  Plus a few things like removing braces 
(byte count) and other esoteric things (some based on timings, some based on intuition 
- which can go both ways :)

  I found several interesting results on differing hosts, php versions and the like.  
The increase was significant, but by no means conclusive.  Certain optimizations work 
great on certain versions, and yet slow them down on others.  Many, many iterations 
are needed to see any relevant data, and frankly I'm too afraid to test it on a 
high-load site.

  Speed is an elusive beast, best left to the last battle, and only if entirely 
necessary.  (Having just read what I wrote, you can quote me on that :)

>I hadn't been concentrating on this, and I haven't tested it myself.  I've
>seen Rasmus make comments to the effect that it doesn't matter.  I'll
>spend a bit of time trying to convince myself it's worth it.

  John
--
/* SteeleSoft Consulting  John Steele - Systems Analyst/Programmer
 *  We also walk dogs...  [EMAIL PROTECTED] - PHP/MySQL/Linux/Hosting
 *                        http://www.gamecomputer.com/ssc/
 */


------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to