Re: Is there a big speed difference...

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

 



Not sure which is faster, you would have to run a quick test to truly see. From a design standpoint, I would put the function in a class and load the class early in the file. You can then override the function, make changes to the number of parameters or other "flexibility" actions. The function also has it's own variable scope, which can be very helpful depending on what you are doing. You can't do that with an included file.

If you do use and include, you most certainly should use include_once instead, unless you are dependent on changing/new variables in the loop.

On Jun 9, 2005, at 12:15 PM, 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?

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


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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