You are here: Re: [PHP] Is there a big speed difference... « PHP « IT news, forums, messages
Re: [PHP] Is there a big speed difference...

Posted by Brent Baisley on 06/09/05 20:22

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация