Hi,

I'm working on a 350+ line message board script with multiple SQL queries,
etc.

It's starting to get a noticeable (although not major) lag.  It's probably
the multiple MySQL queries, which I'm going to attempt to minimise and
optimise, but it also brings me to a question about if().

does the process of PHP digging it's way through multiple nested if()
statements slow down PHP, perhaps in comparison to a single line with an
include?

eg

<?
if($something)
    {
    //
    // 100 lines of code, queries and nested if()'s
    //
    }
?>

versus

<?
if($something)
    {
    include('100_lines_of_code.inc');
    }
?>

I personally like developing with include() files and keeping everything
modular, but have been avoiding this in part, due to the multiple includes
already found on my pages (eg sessions, fonts, config, header, footer,
content, function libraries = 7+ includes per page) and the possible concern
of so many includes slowing things down.

BUT, if larger if() blocks can cause a simular bottle-neck, then maybe i'll
go back to multiple includes...


Is there a good way to time scripts too?  All I can think of is comparing
time() or microtime() from the start and end of the scripts.


Thanks,

Justin French


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

Reply via email to