|Caching always loading files in PHP||#1|
file I always load some classes used later. From profiler it states it sometimes can take about 20% of entire code. Is there any improvement that can make this process faster?
I would try to make this list of classes shorter, but app is very big and checking all dependencies will be costly.
posted date: 2008-12-10 13:35:00
|Re: Caching always loading files in PHP||#3|
You might want to look at apc php.net/apc
posted date: 2008-12-10 13:41:00
|Re: Caching always loading files in PHP||#4|
Op-code caches such as APC and eAccelerator store a compiled version of your scripts in a cache. This dramatically reduces memory usage and loading time for frequently used static scripts.
posted date: 2008-12-10 13:43:00
|Re: Caching always loading files in PHP||#5|
While using an opcode cache (such as APC) will reduce the impact of loading/parsing/compiling the class, you'll still be loading them all on every page load & doing whatever initialization accompanies a require_once() call. If you were to set up an autoload function then the classes won't be loaded until your code actually needs to use them. There's a little overhead involved in using a class autoloader but it makes the code easier to maintain.As always, YMMV, so benchmark your application to see if it's worthwhile in your case.
posted date: 2008-12-10 14:14:00
|select page: « 1 »|