[issue3207] hgeol makes hgwebdir very slow

Antoine Pitrou bugs at mercurial.selenic.com
Mon Jan 16 19:34:30 CST 2012


New submission from Antoine Pitrou <pitrou at free.fr>:

See investigation at
http://www.selenic.com/pipermail/mercurial/2012-January/041461.html

http://hg.python.org/ is/was very slow because of eager revlog parsing on
many of our repositories at each makeindex() call. That parsing is because
of the eol extension being enabled on those repositories.

For the record, I've applied the following hack to make the index page fast:

diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -276,18 +276,12 @@
                 url = re.sub(r'/+', '/', '/'.join(parts) + '/')
 
                 # update time with local timezone
+                spath = os.path.join(path, '.hg', 'store')
                 try:
-                    r = hg.repository(self.ui, path)
-                except IOError:
+                    d = (get_mtime(spath), util.makedate()[1])
+                except OSError:
                     u.warn(_('error accessing repository at %s\n') % path)
                     continue
-                except error.RepoError:
-                    u.warn(_('error accessing repository at %s\n') % path)
-                    continue
-                try:
-                    d = (get_mtime(r.spath), util.makedate()[1])
-                except OSError:
-                    continue
 
                 contact = get_contact(get)
                 description = get("web", "description", "")

----------
messages: 18649
nosy: mg, pitrou
priority: bug
status: unread
title: hgeol makes hgwebdir very slow
topic: eol

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3207>
____________________________________________________


More information about the Mercurial-devel mailing list