Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 25185:bf6b476f3b36
treemanifest: cache directory logs and manifests
Since manifests instances are cached on the manifest log instance, we
can cache directory manifests by caching the directory manifest
logs. The directory manifest log cache is a plain dict, so it never
expires; we assume that we can keep all the directories in memory.
The cache is kept on the root manifestlog, so access to directory
manifest logs now has to go through the root manifest log.
The caching will soon not be only an optimization. When we start
lazily loading directory manifests, we need to make sure we don't
create multiple instances of the log objects. The caching takes care
of that problem.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 10 Apr 2015 23:12:33 -0700 |
parents | 3f0744eeaeaf |
children | 451df92cec49 |
comparison
equal
deleted
inserted
replaced
25184:819cd397e306 | 25185:bf6b476f3b36 |
---|---|
459 @storecache('00manifest.i') | 459 @storecache('00manifest.i') |
460 def manifest(self): | 460 def manifest(self): |
461 return manifest.manifest(self.svfs) | 461 return manifest.manifest(self.svfs) |
462 | 462 |
463 def dirlog(self, dir): | 463 def dirlog(self, dir): |
464 return manifest.manifest(self.svfs, dir) | 464 return self.manifest.dirlog(dir) |
465 | 465 |
466 @repofilecache('dirstate') | 466 @repofilecache('dirstate') |
467 def dirstate(self): | 467 def dirstate(self): |
468 warned = [0] | 468 warned = [0] |
469 def validate(node): | 469 def validate(node): |