Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 3571:736a78469a85
log speedup: walkchangerevs: filter the files only if we need them
This speeds up hg log and significantly reduces memory usage (max RSS
goes from ~92MB to ~21MB on the kernel repo), since we no longer store
all the revisions in the cache.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 28 Oct 2006 20:21:52 -0300 |
parents | 23f7d9621783 |
children | fe03c9a476f6 |
comparison
equal
deleted
inserted
replaced
3570:c141d07198b9 | 3571:736a78469a85 |
---|---|
228 yield 'window', revs[0] < revs[-1], revs[-1] | 228 yield 'window', revs[0] < revs[-1], revs[-1] |
229 nrevs = [rev for rev in revs[i:i+window] if want(rev)] | 229 nrevs = [rev for rev in revs[i:i+window] if want(rev)] |
230 srevs = list(nrevs) | 230 srevs = list(nrevs) |
231 srevs.sort() | 231 srevs.sort() |
232 for rev in srevs: | 232 for rev in srevs: |
233 fns = fncache.get(rev) or filter(matchfn, change(rev)[3]) | 233 fns = fncache.get(rev) |
234 if not fns: | |
235 def fns_generator(): | |
236 for f in change(rev)[3]: | |
237 if matchfn(f): | |
238 yield f | |
239 fns = fns_generator() | |
234 yield 'add', rev, fns | 240 yield 'add', rev, fns |
235 for rev in nrevs: | 241 for rev in nrevs: |
236 yield 'iter', rev, None | 242 yield 'iter', rev, None |
237 return iterate(), matchfn | 243 return iterate(), matchfn |
238 | 244 |