git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Luke Lu
Message 2 of 2 in “gitweb: speed up project listing by limiting find depth”
  1. gitweb: speed up project listing by limiting find depthLuke Lu, Oct 17, 2007
  2. Shawn O. PearceOct 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.