Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- When is the php code loading to main memory?
- Kim Gijung
August 17, 2004, 6:16 am
rate this thread
I got some problems for php performance.
I have big php file which size is around 70K.
And When i request simple one it is too slow.
So i printed time stamp to find which part is slow.
And i finally found some facts.
When I printed time stamp in a function it takes less than 10 ms.
But When i printed time stamp out of fuction, starting above the
include statement which includes 70k php file, it takes more than 1000
I heard that php code is loading to main memory only one time except
when it's modified.
Only when php file modified it loades the php code to main memory
Is it wrong concept?
only way i can do is to split the big php file to small pieces?
Are there any better solution?
Re: When is the php code loading to main memory?
The Zend engine trys to work more efficiently by caching parsed code.
You need to profile your code to see what code you regually use and what is
only occasionally used. Move the rarely used code into seperate files and
only include then when needed.
You also need to examine your programming to see if you are actually writing
in the most efficent style. 70k is a very big program, are you sure you'd
not be better off reducing some of the code into more generic