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

Re: gitweb.cgi

From
KSKay Sievers <kay.sievers@vrfy.org>
Date
Oct 19, 2005, 01:23 UTC
Message-ID
<20051019012341.GA15256@vrfy.org>
In-Reply-To
<Pine.LNX.4.64.0510181753340.3369@g5.osdl.org>
On Tue, Oct 18, 2005 at 06:02:29PM -0700, Linus Torvalds wrote:
Show 37 quoted lines
> 
> 
> On Tue, 18 Oct 2005, H. Peter Anvin wrote:
> > 
> > It turns out that the default CacheSize is only 256K.  D'oh!  Fixed.
> > 
> > I also changed the CacheDefaultExpire to 600 seconds.
> 
> Ok, that sounds like it should improve things. My quick tests didn't seem 
> to show any difference, though. Do you need to re-load the apache module 
> or something?
> 
> > The only thing the front page really should need is to know when the last
> > change to the tree was, which presumably means looking at each head of each
> > tree and follow the chain until there is a datable object.
> 
> Yeah. I tried to follow gitweb.cgi, but I'm neither http- nor 
> perl-literate, so I'm not sure I caught everything.
> 
> But it does seem to basically end up doing a "git_read_commit()" for each 
> project, and that in turn was doing the "git-rev-list --max-count=1" thing 
> that I just sent out a suggested improvement for.
> 
> It effectively removes two or more copies of
> 
> 	stat64("/objects/xy/zzy", {...})
> 	fd = open("objects/xy/zzy", O_RDONLY|O_NOATIME)
> 	addr = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0)
> 	close(fd)
> 	munmap(addr, size)
> 
> which really should be very cheap operations, but hey, if the disk head is 
> somewhere else (and busy) and it's not cached, it can be quite expensive. 
> Especially since we don't end up usign the result.
> 
> I'm sure there's room for improvement inside gitweb itself too, but maybe 
> the git-rev-list optimization will help.

There definitely is! But I tried a single "stat() all HEAD files" with a simple script and it took more than 3 seconds for the 80 trees. Then I gave up "optimizing" and was sure we want to have a single-file cached front page instead. :)

Kay
Previous: H. Peter AnvinNext: Kay Sievers
Message 14 of 15 in “gitweb.cgi”
  1. H. Peter AnvinOct 18, 2005
  2. Kay SieversOct 18, 2005
  3. H. Peter AnvinOct 18, 2005
  4. H. Peter AnvinOct 18, 2005
  5. Brian GerstOct 18, 2005
  6. Linus TorvaldsOct 19, 2005
  7. H. Peter AnvinOct 19, 2005
  8. Optimize common case of git-rev-list (was Re: gitweb.cgi)Linus Torvalds, Oct 19, 2005
  9. H. Peter AnvinOct 19, 2005
  10. Linus TorvaldsOct 19, 2005
  11. H. Peter AnvinOct 19, 2005
  12. Linus TorvaldsOct 19, 2005
  13. H. Peter AnvinOct 19, 2005
  14. Kay SieversOct 19, 2005
  15. Kay SieversOct 19, 2005

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.