Re: [PHP] Is there a big speed difference...

2005-06-12 Thread Brian Dunning
On Jun 11, 2005, at 6:24 PM, Richard Lynch wrote: Have you actually tried it yet, either way? Cuz I suspect you are worrying over a lot of nothing... I did post the results a couple of days ago. Switching to a function made an enormous difference. It went from an average of 45 seconds to

Re: [PHP] Is there a big speed difference...

2005-06-11 Thread Richard Lynch
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

[PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning
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

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas
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? or (c) just

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning
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

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning
On Jun 9, 2005, at 9:44 AM, Jochem Maas wrote: or (c) just placing the code inside the loop - no function call , no include, just wash and go ;-) - whichever is faster of (a) and (b), my (c) will be faster still. :-) I agree (c) would be swell but this is a function that I call from many

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brent Baisley
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

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas
Brian Dunning wrote: On Jun 9, 2005, at 9:44 AM, Jochem Maas wrote: or (c) just placing the code inside the loop - no function call , no include, just wash and go ;-) - whichever is faster of (a) and (b), my (c) will be faster still. :-) I agree (c) would be swell but this is a function

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning
On Jun 9, 2005, at 10:54 AM, Jochem Maas wrote: unless you intend to make a call to your function from inside the include file, No, the question is which of the two to use, not both. :) I've built a version that uses a function, will test, and will post the results. -- PHP General

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas
Brent Baisley wrote: 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

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Chris Shiflett
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

RE: [PHP] Is there a big speed difference...

2005-06-09 Thread bruce
Message- From: Chris Shiflett [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 10:34 AM To: Brian Dunning Cc: php-general@lists.php.net Subject: Re: [PHP] 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

Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Chris Shiflett
bruce wrote: in all honesty, it would really depend on how good the compiler/optimizer is. No, it doesn't. Path resolution must still be performed, and this is going to result in at least one stat() and one realpath() call. These are expensive. Chris -- Chris Shiflett Brain Bulb, The PHP