Re: parse speed vs require speed
| From: | Chris Lee | Date: | Tue, 13 Feb 2001 21:49:56 +0000 |
| Subject: | Re: parse speed vs require speed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39505@lists.php.net to get a copy of this message | ||
Accoring to Microsofts book 'Rapid Development' (dont knock it, excellent
book) says the average human can not keep track of more then 500 lines of
code at once, I beleive it. I break my code up into sections smaller then
500 lines, keeps the code better. load time because files are distributed is
minimal. Everything comes down to cost, the little it would cost to add more
ram/cpu to compinsate for this *minor* overhead would be 100x cheaper then
extra time spent in development due to huge files being confusing...
--
Chris Lee
Mediawaveonline.com
em. lee@mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
"Soma Interesting" <dfunct@telus.net> wrote in message
news:5.0.2.1.0.20010213120555.00ad8f20@pop.telus.net...
>
> I'm wondering if I should organize the functions for my project into a
> single large file and have only one include/require, or break the code out
> into separate function library files and use a number of
includes/requires.
>
> With a single large function library I'm guessing PHP would parse this
> every time a page is called. So I could loose some overhead by separating
> my database functions into one file, my administration functions into
> another, my presentation functions into another, etc... then only
including
> the function pages necessary - likely cutting the amount of code being
> parsed in half for any given page.
>
> But then I begin wondering about the speed of making a require() to each
of
> these files. maybe three to five requires per page.
>
> Lastly, what about caching or compiling the function libraries so they're
> not being parsed each time?
>
> Any advice on this?
>
>
> - - - - - - -
> - - - -
> WARNING: Some experts believe that use of any keyboard may cause
> serious injury. Consult Users Guide.
>
dfunct@telus.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>