Re: functions versus includes

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

 



Nathan Nobbe wrote:
On Nov 11, 2007 11:52 PM, Chris <dmagick@xxxxxxxxx <mailto:dmagick@xxxxxxxxx>> wrote:

    As I said, it's a micro-optimization *shrug*. 0.0004 seconds difference
    over 10 iterations - wow ;)


actually it was just one iteration; the output isnt very clear, but thats the
value of a variable.
anyway, i was surprised to see the function was faster at all.  i though the
include would be faster.
so not only is the function faster (if only but a bit) its also cleaner as well.
i think a decision between the 2 approaches no-brainer.

I'd go for the approach that makes more sense in the application regardless of the milliseconds involved. If that's an include that's what I'll use.

In the scheme of the whole app it won't make any difference.

You'll waste so much time on "optimizing" crap like this when fixing a bad database query will actually make a noticable difference, or instead of calling a function inside a loop 50 times, you call it once and pass all the data in through an array.

--
Postgresql & php tutorials
http://www.designmagick.com/

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