Re: Including PHP scripts on same server [message #171932 is a reply to message #171926] |
Fri, 21 January 2011 20:18 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 1/21/2011 12:08 PM, Leonardo Azpurua wrote:
>
> "jwcarlton" <jwcarlton(at)gmail(dot)com> escribió en el mensaje
> news:5f96a08e-f405-4008-b37e-1fef85b66ecf(at)l24g2000vby(dot)googlegroups(dot)com...
>>> Why does it matter. If you're that concerned about speed of execution,
>>> why are you using php in the first place? You should code your site in
>>> C.
>>
>> That's actually a very good question. If I were a better C programmer,
>> I probably would :-)
>
> :-)
>
> I am above anything else a C programmer. In fact, my first approach to
> web development was a set of C programs that ran as CGI.
>
> It is fine if you host your own domain, but with many hosting providers,
> allowing your own binaries to run is some sort of anathema.
>
> With most OSs, the most consuming operations in file handling are
> "opens", so, yes, it is likely that splitting a large file into several
> small units will add a significant overhead to your script's execution
> time.
>
That's true in compiled languages, but not so much in interpreted
languages such as PHP. Unlike in compiled languages, the interpreter
spends a fair amount of time parsing the scripts and converting them to
instructions the processor can execute. So the overhead of opening a
file is much smaller than in compiled programs.
Additionally, if the file is accessed quite often, it is probably in the
OS's file buffers already (especially if it is read only), so the
overhead is even less.
Not to say that there isn't overhead in opening a file - but it's a very
small percentage of the total time in PHP scripts. There are better
places to look for improvements.
> But if one compares the development time required to navigate and
> maintain a large source file against the time required to open the
> specific file with the specific functions that you have to work with, it
> is likely that the overall life cycle of your program will improve by
> using simpler, smaller units.
>
Very true.
> "Overhead", with modern equipment and OSs, may be safely neglected
> except in the most critical applications.
>
> --
>
Also quite true.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|