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

Re: [PATCH] pretty: lazy-load commit data when expanding user-format

From
Jeff King <peff@peff.net>
Date
Jan 29, 2021, 01:11 UTC
Message-ID
<YBNgq++oV3HorxVM@coredump.intra.peff.net>
In-Reply-To
<87eei4pu3c.fsf@evledraar.gmail.com>
On Thu, Jan 28, 2021 at 11:36:23PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 25 quoted lines
> > -for format in %H %h %T %t %P %p %h-%h-%h
> > +for format in %H %h %T %t %P %p %h-%h-%h %an-%ae-%s
> >  do
> >  	test_perf "log with $format" "
> >  		git log --format=\"$format\" >/dev/null
> 
> 
> While we're at it it would be nice to have a few more formats that have
> to do with the body in some way in those tests, and stess things like
> mailmap/trailers etc.
> 
>     %s
>     %b
>     %B
>     %N
>     %aN-%aE
>     %cn-%ce
>     %cN-%cE
>     %d
>     %D
>     %(trailers)
> 
> Just paging over the git-log manpage, that seems to stress most of the
> codepaths, i.e. subject/body, but also things like notes, .mailmap, ref
> names, and body parsing (trailers).

I'd prefer not to do so in this patch, since most of those aren't providing any new data.

I don't mind _too_ much if you'd like to do so on top for general regression-testing, but I'm generally a bit hesitant to throw a lot of stuff into the perf suite without a sense of what it's measuring, just because it already takes forever to run. So for example, is the difference between %aN-%aE and %cN-%cE worth spending 21 seconds of CPU (3 times the 7 seconds it takes to run on the kernel)?

One test to check mailmap performance, or one for trailers, seems like it might be more directed. I think the existing test is likewise a bit wasteful in checking %h _and_ %t _and_ %p), though at least it is now much faster after my patch. ;)

(In the regular test suite, we of course should be covering all these for correctness already, and I think we do).

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Taylor Blau
Message 3 of 5 in “pretty: lazy-load commit data when expanding user-format”
  1. pretty: lazy-load commit data when expanding user-formatJeff King, Jan 28, 2021
  2. Ævar Arnfjörð BjarmasonJan 28, 2021
  3. Jeff KingJan 29, 2021
  4. Taylor BlauJan 28, 2021
  5. Junio C HamanoJan 28, 2021

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.