Indefero

Indefero Commit Details


Date:2009-01-06 15:56:02 (16 years 3 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:a6c42120d8763f079ebcdaf8a7e47ea04123d82f
Parents: a30a62d48f54d953663a9b5c1e82f54a139212ae
Message:Improved issue 93, memory usage.

I have been doing tracing of the memory usage using xdebug, now I am
normally below 15MB for the linux kernel instead of 35MB. Please test.
Changes:

File differences

src/IDF/Scm/Git.php
115115
116116
117117
118
118
119119
120120
121121
......
166166
167167
168168
169
169
170170
171171
172172
173173
174
174
175175
176176
177177
178
178
179179
180180
181181
            // As we are limiting to a given folder, we need to find
            // the tree corresponding to this folder.
            $found = false;
            foreach ($this->getTreeInfo($co->tree) as $file) {
            foreach ($this->getTreeInfo($co->tree, true, $folder) as $file) {
                if ($file->type == 'tree' and $file->file == $folder) {
                    $found = true;
                    $tree = $file->hash;
     * @param bool Do we recurse in subtrees (true)
     * @return array Array of file information.
     */
    public function getTreeInfo($tree, $recurse=true)
    public function getTreeInfo($tree, $recurse=true, $folder='')
    {
        if ('tree' != $this->testHash($tree)) {
            throw new Exception(sprintf(__('Not a valid tree: %s.'), $tree));
        }
        $cmd_tmpl = 'GIT_DIR=%s git ls-tree%s -t -l %s';
        $cmd_tmpl = 'GIT_DIR=%s git ls-tree%s -t -l %s %s';
        $cmd = sprintf($cmd_tmpl,
                       escapeshellarg($this->repo),
                       ($recurse) ? ' -r' : '',
                       escapeshellarg($tree));
                       escapeshellarg($tree), escapeshellarg($folder));
        $out = array();
        $res = array();
        IDF_Scm::exec($cmd, $out);

Archive Download the corresponding diff file

Page rendered in 0.24482s using 14 queries.