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 "Richard Lynch" on 09/28/82 11:18

On Thu, June 9, 2005 10:06 am, Brian Dunning said:
>
> On Jun 9, 2005, at 9:48 AM, bruce wrote:
>
>> bian...
>>
>> giave a psuedocode example of what you're trying to compare.. i
>> think i know
>> what you're asking, but i want to be sure..
>
> OK, this is *pseudocode* remember... :)
>
> Is either of these SIGNIFICANTLY slower:
>
> === Example 1 ===
>
> while(loops 5000 times)
> {
> include(myfunction.php);

Assuming there is not function in myfunction.php, and it's just raw
PHP/HTML code...

This is slower, UNLESS you have something like Zend Cache (or whatever
it's called now) *AND* that is configured to not check filemtime on every
hit...

At that point, this could probably be faster.

> }
>
> ...where myfunction.php contains some code.
>
> === Example 2 ===
>
> include_once(myfunction.php);
> while(loops 5000 times)
> {
> myfunction(xxx);
> }
>
> ...where myfunction.php defines the function myfunction().

The overhead for a function is not zero, but it also depends a little bit
on what arguments you are passing to the function.

Have you actually tried it yet, either way?

Cuz I suspect you are worrying over a lot of nothing...

Try it the cleanest most maintainable way.

Worry about performance after it fails.

"Look before you leap" is good advice, but not when don't have enough data
to "look" -- Find out if it's "too slow" then make an informed decision.

Especially for 6 lines of code.

5,000 iterations isn't gonna kill you, I'll bet.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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