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

Re: Git blame performance on files with a lot of history

From
Derrick Stolee <stolee@gmail.com>
Date
Dec 14, 2018, 21:31 UTC
Message-ID
<3f3e7b11-19ef-cc2f-3bd4-e03d9ba8dc91@gmail.com>
In-Reply-To
<CABXAcUzoNJ6s3=2xZfWYQUZ_AUefwP=5UVUgMnafKHHtufzbSA@mail.gmail.com>
On 12/14/2018 1:29 PM, Clement Moyroud wrote:
Show 5 quoted lines
> My group at work is migrating a CVS repo to Git. The biggest issue we
> face so far is the performance of git blame, especially compared to
> CVS on the same file. One file especially causes us trouble: it's a
> 30k lines file with 25 years of history in 3k+ commits. The complete
> repo has 200k+ commits over that same period of time.

I think the 30k lines is the bigger issue than the 200k+ commits. I'm not terribly familiar with the blame code, though.

Show 5 quoted lines
> Currently, 'cvs annotate' takes 2.7 seconds, while 'git blame'
> (without -M nor -C) takes 145s.
>
> I tried using the commit-graph with the Bloom filter, per
> https://public-inbox.org/git/61559c5b-546e-d61b-d2e1-68de692f5972@gmail.com/.

Thanks for the interest in this prototype feature. Sorry that it doesn't appear to help you in this case. It should definitely be a follow-up when that feature gets polished to production-quality.

Show 7 quoted lines
> Looking at the blame code, it does not seem to be able to use the
> commit graph, so I tried the same rev-list command from the e-mail,
> using my own file:
>      > GIT_TRACE_BLOOM_FILTER=2 GIT_USE_POC_BLOOM_FILTER=y
> /path/to/git rev-list --count --full-history HEAD -- important/file.C
>      3576
>

Please double-check that you have the 'core.commitGraph' config setting enabled, or you will not read the commit-graph at run-time:

     git config core.commitGraph true

I see that the commit introducing GIT_TRACE_BLOOM_FILTER [1] does nothing if the commit-graph is not loaded.

Thanks, -Stolee

[1] https://github.com/derrickstolee/git/commit/adc469894b755512c9d02f099700ead2a7a78377

Previous: Clement MoyroudNext: Clement Moyroud
Message 4 of 7 in “Git blame performance on files with a lot of history”
  1. Clement MoyroudDec 14, 2018
  2. Bryan TurnerDec 14, 2018
  3. Clement MoyroudDec 17, 2018
  4. Derrick StoleeDec 14, 2018
  5. Clement MoyroudDec 17, 2018
  6. Ævar Arnfjörð BjarmasonDec 14, 2018
  7. Clement MoyroudDec 17, 2018

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.