Re: Structure of PHP files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Paul M Foster wrote:
On Thu, Jul 23, 2009 at 09:34:37AM -0400, Robert Cummings wrote:

<snip>

Not that I disagree with your methodology at this time, but you could
have just made that single big file, include all those little files and
still had a single load statement in each of your consumer source files.
With compile caches the burden of loading all that code at startup is
rather negligible :)

I've heard this before, and I don't understand why people say this. If
you have a 150k file you load before displaying a page, you've still
occupied the CPU with the task of loading a 150k file. What happens to
it afterward (compiling, compressing, caching, whatever) is another
issue. You've still loaded 150k of code. The question is whether you
actually need to load 150k of code from the start. If not, why waste the
resources?

150k is peanuts and having it already in memory means it doesn't have to be loaded later. With a compile cache it's quite likely that over time you'll have the 150k loaded into memory anyways. It's just going to take longer for it to be loaded since the compile cache has to "encounter" it first. Once "encountered" it's still occupying the same memory. Additionally, the operating system does an excellent job of swapping memory not being accessed regularly (if it needs memory).

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux