Slow hgweb.cgi

Dominik Psenner dpsenner at gmail.com
Fri Apr 15 01:32:05 CDT 2011


Good morning!

Looks like a break-through on this issue!

I just re-checked all repositories and have seen one repos was not updated
to null and thus had insight some files/folders. Once I did hg up null there
I was able change the configuration back to:

[paths]
/ = repos/*

without performance penalties.

So there's possibly a regression for the case when a repository is not
updated to null. How does the current directory walker code crawl
directories for repositories? I would suppose that it first checks if the
current directory contains an ".hg" directory and only recurse into other
directories (at the same level) when there's none? If not, we could discuss
to refactor those parts respectively? I.e.:

-- quote --
def findRepos(directory):
  isReposRoot = False
  for dir in directory:
    if dir = ".hg":
      isReposRoot = True
      break
  if isReposRoot:
    # found repos
    return dir
  else:
    # recurse
    res = []
    for dir in directory:
      res.append(dir)
    return res
-- eof --

Greetings,
D.

> -----Original Message-----
> From: Mads Kiilerich [mailto:mads at kiilerich.com]
> Sent: Friday, April 15, 2011 12:37 AM
> To: Dominik Psenner
> Cc: mercurial-devel at selenic.com
> Subject: Re: Slow hgweb.cgi
> 
> Dominik Psenner wrote, On 04/14/2011 09:13 AM:
> > This explains why hg serve works well. It's within the hgwebdir_mod and
> thus
> > this code is executed only by the cgi script.
> 
> Note the --web-conf option to hg serve.
> 
> > Could it be that the walker is recursing into .hg directories and
> searching
> > there for repositories?
> 
> Hardly (except that it checks .hg/patches).
> 
> You could try to find a strace-like tool for your platform and check
> what really is going on.
> 
> /Mads



More information about the Mercurial-devel mailing list