Ticket #7746 (closed defect: fixed)
Browse Source is too slow on a big repo
| Reported by: | maxim.vuets@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | highest | Milestone: | not applicable |
| Component: | plugin/mercurial | Version: | 0.11.1 |
| Severity: | critical | Keywords: | |
| Cc: | maxim.vuets@…, bkocherov@… |
Description
I have a big repo -- ~11.5K of files and ~200 MB .hg dir. And Browse Source takes 140 seconds to show a root of repo. It's ugly! Looks like design defect.
I've found the bottleneck--it is MercurialNode._init_path(). There is a comment:
As directories are not first-class citizens in Mercurial, retrieving revision information for directory is much slower than for files.
As I understand Christian follows a repo tree in depth to obtain all files' revisions and such way gets dir's revision. (I may wrong.) And I cannot understand why such strange and slow method is used. Mercurial can give dir's revision itself. It is much quickly and simply, look:
~$ hg init hg-test ~$ cd hg-test/ hg-test$ mkdir somedir hg-test$ touch file somedir/some somedir/thing hg-test$ hg ci -Am 'init' adding file adding somedir/some adding somedir/thing hg-test$ echo abc >>file hg-test$ echo def >>somedir/some hg-test$ hg ci -m '2nd' hg-test$ echo ghi >>file hg-test$ hg ci -m '3rd' hg-test$ hg id -n 2 hg-test$ hg log -l1 --style=compact somedir/some 1 e56a4a4c991e 2008-10-22 17:47 +0300 maxim 2nd hg-test$ hg log -l1 --style=compact somedir/thing 0 d10179c1216f 2008-10-22 17:46 +0300 maxim init hg-test$ hg log -l1 --style=compact somedir 1 e56a4a4c991e 2008-10-22 17:47 +0300 maxim 2nd


