On Thu, Jun 06, 2002 at 07:52:28PM +1000, Justin French wrote:

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

If() statements definitely slow programs down.  BUT, the size of the
code inside the if satement isn't the real issue.  It's the process of
making the true/false decision that takes the work.  Of course, the
longer the code inside the if statement, the longer it takes run that
particular part of the code if that code is executed.


> I personally like developing with include() files and keeping everything
> modular,

Regarding includes, they add overhead.  Includes come in handy where
the included file is used in other scripts too.


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

Yep.  That's the simplest thing to do, but I believe there are 
benchmarking classes/functions out there.

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409

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

Reply via email to