RE: Is there a big speed difference...

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

 



in all honesty, it would really depend on how good the compiler/optimizer
is.. but since you're dealing with php.. and i assume that there's not a
good (if any) optimization process...

i would tend to say, include the function/file once, use the function as
required...

-bruce


-----Original Message-----
From: Chris Shiflett [mailto:shiflett@xxxxxxx]
Sent: Thursday, June 09, 2005 10:34 AM
To: Brian Dunning
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  Is there a big speed difference...


Brian Dunning wrote:
> I have an include file with about 6 lines of code, just text parsing.
> If I have to loop through 5000 records, is there a big difference
> between (a) calling this include file 5000 times, and (b) defining a
> function and just calling the function 5000 times?

Yes, there is a big difference. Including files is expensive, even with
a compiler cache.

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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

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