|
Posted by C. (http://symcbean.blogspot.com/) on 01/29/08 13:14
On 28 Jan, 02:41, Roberto <8...@myway.com> wrote:
> I read on a website recently that using require_once, although it
> sounds like a nice idea, actually is processor expensive. But the guy
> who posted that didn't say what else is faster:
>
> * require
> * include
> * include_once
>
> Which is fastest?
You missed out __autoload()
There's not a lot of difference in performance - there is a lot of
difference in the functionality - which should determine which you
use. RTFM
How you use include files in general all rather depends on the scale
of your application in terms of lines of code and traffic volumes.
IME it's not particularly CPU intensive but having a lot of includes
can use up more memory than if the code were inline - but splitting
code into multiple files makes it easier to only load the code you
need (saving memory and CPU) and (unless you are Google, this next one
is typically the decider) makes managing your code much easier.
IIRC there used to be a tool out there which would inline code
automatically - a sort of precompiler. But I suspect it won't handle
all the scenarios that would be resolved by an explicit include or
__autoload
C.
Navigation:
[Reply to this message]
|