Re: [PATCH] gitweb: speed up project listing by limiting find depth
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Oct 17, 2007, 00:41 UTC
- Message-ID
- <20071017004125.GI13801@spearce.org>
- In-Reply-To
- <1192580691-14308-1-git-send-email-git@vicaya.com>
Luke Lu <git@vicaya.com> wrote:
Show 9 quoted lines
> diff --git a/Makefile b/Makefile > index 8db4dbe..b70ba8c 100644 > --- a/Makefile > +++ b/Makefile > @@ -165,6 +165,7 @@ GITWEB_CONFIG = gitweb_config.perl > GITWEB_HOME_LINK_STR = projects > GITWEB_SITENAME = > GITWEB_PROJECTROOT = /pub/git > +GITWEB_PROJECT_MAXDEPTH = 2
I'd rather see this default to an unlimited (or maybe insane?) depth. Current users may be surprised upon upgrading to a more recent git when their gitweb stops showing projects because the default depth is too small.
repo.or.cz is up at 3 deep, maybe 4 right now, right Pasky? I think letting admins control the depth is a good idea, but its a performance tuning thing and probably shouldn't break existing setups.
> + # don't traverse too deep (Find is super slow on os x) > + return if tr!/!! - $pfxdepth > $project_maxdepth && ($File::Find::prune = 1);
I don't do much gitweb hacking, but I usually don't like to find code that mutates a value as an important side-effect in the middle of a boolean condition that is used to determine if we are breaking out of this function now, or falling through to do more work. yea its more lines of code but I think it would be easier to grok if this was a proper if {...}.
-- Shawn.