Re: Script's length, echo, and execution speed

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

 



if performance/profiling this script is very important then take up the various
suggestionms for doing just that - the only useful performance answer is the one you
garner from your own testing (i.e. within your own env/setup)

with regard to the 3500 lines of code (with 300 odd being run on any one request)
and the fact that most of those lines are *very* simple echo statement I doubt
very much you have *anything* to worry about with regard to performance.
imho it sounds like your script is very simple and php will zip thru it like lightening.

it's not unlikely if your running a big,complex application to run 100K+ LOC within a
single request - the question is not so much how many LOC but how fast are those lines -
obviously the power of your hardware play an integral part in determining what is
exceptable/doable.

with regard to 'optimizing' echo statements and keeping some kind of eye-pleasing
formatting below are a couple of suggestions:

Jean-Christophe Roux wrote:
> Hello,
> 
> I have this php script of 3,500 lines with a big switch that is such that on 
> each pass maybe 300 lines of codes are executed at most. The current speed 
> of the file is ok. I like to keep the file like that because at each pass 
> there is a check on the whole script and it fails if there is a typo 
> somewhere. Also, I like to have one file instead of many files. But I am 
> wondering if speed is not severaly hurt. What are the general guidelines in terms 
> of length of script?
> 
> Also, I am writing things like that:
>     echo '<table>';
>     echo '<tr>';
>     echo "<td>Content</td>";
>     echo '</tr>';
>     echo '</table>';

echo '<table>
        <tr>
          <td>Boo!</td>
	</tr>
      </table>';

// OR

$Content = 'Boo!';
echo '<table>',
     '<tr>',
     "<td>$Content</td>",
     '</tr>',
     '</table>';

-- 
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