Mercurial > hgsubversion
comparison hgsubversion/maps.py @ 1251:46cec117dda2
maps.RevMap: disable GC while loading the revmap
The revmap load process creates lots of tiny objects.
With just the bare minimum Mercurial runtime, loading a million-file revmap
goes from 6.83 seconds to 6.28. For longer running processes (e.g. hg push a
series of changes) the difference will probably be dramatic.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sun, 02 Nov 2014 02:01:05 -0800 |
parents | a10a4fc69364 |
children | a321afbc3479 |
comparison
equal
deleted
inserted
replaced
1250:05aea77371a3 | 1251:46cec117dda2 |
---|---|
218 ver = int(f.readline()) | 218 ver = int(f.readline()) |
219 if ver != cls.VERSION: | 219 if ver != cls.VERSION: |
220 raise hgutil.Abort('revmap too new -- please upgrade') | 220 raise hgutil.Abort('revmap too new -- please upgrade') |
221 return f | 221 return f |
222 | 222 |
223 @util.gcdisable | |
223 def _load(self): | 224 def _load(self): |
224 for l in self.readmapfile(self.meta.revmap_file): | 225 for l in self.readmapfile(self.meta.revmap_file): |
225 revnum, ha, branch = l.split(' ', 2) | 226 revnum, ha, branch = l.split(' ', 2) |
226 if branch == '\n': | 227 if branch == '\n': |
227 branch = None | 228 branch = None |