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

Re: Trac+Git: rev-list with pathspec performance?

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 5, 2010, 01:09 UTC
Message-ID
<m3r5g5fnth.fsf@localhost.localdomain>
In-Reply-To
<27777603.436995.1286223710787.JavaMail.root@mail.hq.genarts.com>
Stephen Bash <bash@genarts.com> writes:
Show 16 quoted lines
> I'm trying to improve the performance of Trac [1], the GitPlugin for
> Trac[2], and Git.  Trac is being extremely sluggish while browsing
> source, and profiling revealed the majority of the time was the
> GitPlugin calling git rev-list.  When I directly entered the
> rev-list calls from the shell, I found Git itself was performing
> slower than I would expect...
> 
> The bottleneck is while Trac is populating the "last change to file"
> column in the source browser (see the "rev" column of [3] for an
> *cough* SVN *cough* example).  This concept of "find the last change
> to a file" was discussed a few weeks ago [4], but unlike that
> thread, the GitPlugin is simply calling git rev-list --max-count=1
> branchName -- fileName for each file in the current directory.  For
> files modified recently this is very fast (thousandths of a second),
> but for older files rev-list takes a long time to come up with an
> answer (~2-3 seconds on our server).
[...]
Show 5 quoted lines
> References:
> [1] http://trac.edgewall.org
> [2] http://trac-hacks.org/wiki/GitPlugin
> [3] http://trac.edgewall.org/browser/trunk
> [4] http://article.gmane.org/gmane.comp.version-control.git/150183/

Note that later[5] in mentioned thread[4] there is proof of concept "tree blame" (in Perl) which generates such 'last change to file' information, I think faster than running 'git rev-list -1 <file>' for each file. Even better would be to encode used algorithm in C.

[5] http://thread.gmane.org/gmane.comp.version-control.git/150063/focus=150183

P.S. Alternate solution would be to simply get rid of SVN-inspired view. Git tracks history of a *project* as a whole, not set of histories for individual files (like CVS).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jonathan NiederNext: Stephen Bash
Message 3 of 6 in “Trac+Git: rev-list with pathspec performance?”
  1. Stephen BashOct 4, 2010
  2. Jonathan NiederOct 4, 2010
  3. Jakub NarebskiOct 5, 2010
  4. Stephen BashOct 6, 2010
  5. Stephen BashOct 7, 2010
  6. Jakub NarebskiOct 7, 2010

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.