Re: long echo statement performance question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/2/6 Frank Stanovcak <blindspotpro@xxxxxxxxxxx>:
>
> "Richard Heyes" <richard@xxxxxxx> wrote in message
> news:af8726440902060918v6d2f1ee1ia3f8391898747b2@xxxxxxxxxxxxxxxxx
>>> Wouldn't have thought so. But for readability, you may find this a
>>> little easier instead:
>>
>> Slight correction:
>>
>> ?>
>>    <?=$var1?> blah <?=var2?>
>> <?php
>>
>> --
>> Richard Heyes
>>
>> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
>> http://www.rgraph.org (Updated January 31st)
>
> Actually that's what I'm in the middle of undoing.  The first revision was
> jumping in and out of PHP mode upwards of 60 times per page on the shorter
> pages.  I've read a couple places that that can put a huge performace hit on
> things, so I was just trying to simplify the code a bit.  Plus I don't have
> the fast tags, <?=, enabled *blush*

They're called short tags, not fast tags. There is nothing faster
about them beyond the typing effort required.

This question, or rather variations of it, appear on this list at
pretty regular intervals. A little while ago I wrote a script to test
the speed of various output methods.

    http://stut.net/projects/phpspeed/?iterations=10000

As you can see, the difference is so minimal that unless you're doing
it hundreds of thousands of times per script it makes little
difference how you do it.

In short it's usually not worth optimising at this level since greater
gains are certainly to be had by looking at your interaction with
databases or other external resources.

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux