Re: Re: PEAR 1.4.0a9 fixes memory problems in my tests
| From: | Greg Beaver | Date: | Fri, 25 Mar 2005 20:34:28 +0000 |
| Subject: | Re: Re: PEAR 1.4.0a9 fixes memory problems in my tests | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36877@lists.php.net to get a copy of this message | ||
Justin Patrin wrote:
On Fri, 25 Mar 2005 10:52:24 -0500, Davey Shafik <davey@php.net> wrote:That actually only saved about 500k. The big money saver was the changes to PEAR/Command/*.php. Instead of loading the whole class just to determine which commands are present in the file, it loads a very small Command-init.php file for each command (Auth-init.php, Build-init.php, etc.) that contains the array that is used to determine what is in each command file. This cuts a good 2-4 MB of memory right off the bat. It also makes startup faster, I think, but I could be wrong :). Hard to measure these things. GregGreg, This is most excellent to hear, though I could care less (I never had an issue, 1GB RAM and no memory limits :D) except that it will keep a lot of people from bitching at you :) What did you do that caused the reduction in memory usage? I'm curious, probably something we all could learn from and help us to reduce memory usage in all our code (I have been very memory concious in Cerebral Cortex but never done any profiling or anything) :DAFAIK he seperated the package.xml reading and writing into seperate classes. But I didn't read all of the commit messages, so I may be totally wrong. ;-)