But, my friend, if you include that file, PHP _still_ has
to parse it.  You just didn't benchmark.  No matter what

        (which PHP has to interpret)

will beat

        include file_with_big_code_inline
        (which PHP has to interpret)

because of the addition of the call to the kernel.  You
cannot get around this.

Richard Heyes wrote:
> > If you are talking about speed, opening a file is expensive
> > because it is a kernel call, a directory search and all that.
> > Your "some big code" in-line will beat it every time...
> Not in my experience. I have a file which defines ~40 functions, with
> the bodies
> included when the function is called. Eg:
> function blah(){
>         return include('includes/func.blah.inc');
> }
> Having all the function bodies in the same file would cause php to have
> to parse all
> of that code, probably about 3-4000 lines causing awful slowdowns. And
> the reason to define all of
> the functions in one file, is so that we can include that file, and all
> the functions are then available.
> --
> Richard Heyes

Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to