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

Re: [PATCH] Add the --submodule-summary option to the diff option family

From
Jens Lehmann <jens.lehmann@web.de>
Date
Oct 7, 2009, 19:32 UTC
Message-ID
<4ACCECE6.1030508@web.de>
In-Reply-To
<7vocok21pw.fsf@alter.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 11 quoted lines
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>>> But I really, really, really want to avoid a fork() in the common case.  I 
>>> do have some users on Windows, and I do have a few submodules in that 
>>> project.  Having too many fork() calls there would just give Git a bad 
>>> reputation.  And it has enough of that, it does not need more.
>> Me too thinks performance matters here. We do have a repo at my dayjob
>> with more than a handful of submodules and its main target platform is
>> windows ... so having that perform nicely is a win for us.
> 
> Numbers?
Here they are:

First i did them with the repo at hand, current msysgit master with Dscho's git-repo checked out:

  without fork : real	0m0.672s
  with fork    : real	0m0.781s

So here it's a about 16% slower when using fork() (and both are generating about 7270 shortlog entries).

But i thought this to be a rather unusual situation, having only one submodule being changed by 7270 commits ...

So i took a live repo from my dayjob containing 8 submodules. In each submodule i did a "git checkout HEAD^" to simulate one change. And then i got:

  without fork : real	0m0.203s
  with fork    : real	0m0.453s

This is a degradation of more than 120% because of the fork()s. And just for fun i ran the scripted submodule summary too:

  scripted     : real	0m3.437s

So the forked version outperforms the scripted version by a factor of 7, while the speedup from Dscho's original proposal is almost 17fold. (If i did my computations right, the extra costs for each changed submodule are a bit more than 30ms when fork()ing. Dscho's version doesn't seem to suffer from changed submodules at all, i measured 0.203s for both versions before i did the submodule init and update).

(Best of three, "time git diff --submodule-summary". My system is an Athlon64x2 4600+ with WindowsXP)

Jens
Previous: Johannes SchindelinNext: Junio C Hamano
Message 18 of 20 in “Add the --submodule-summary option to the diff option family”
  1. Add the --submodule-summary option to the diff option familyJohannes Schindelin, Oct 4, 2009
  2. Junio C HamanoOct 4, 2009
  3. Johannes SixtOct 5, 2009
  4. Johannes SchindelinOct 5, 2009
  5. Johannes SixtOct 5, 2009
  6. Johannes SchindelinOct 5, 2009
  7. Johannes SchindelinOct 5, 2009
  8. Jens LehmannOct 5, 2009
  9. Jens LehmannOct 5, 2009
  10. Johannes SchindelinOct 5, 2009
  11. Junio C HamanoOct 5, 2009
  12. Johannes SchindelinOct 5, 2009
  13. Jens LehmannOct 6, 2009
  14. Junio C HamanoOct 6, 2009
  15. Johannes SchindelinOct 6, 2009
  16. Jens LehmannOct 6, 2009
  17. Johannes SchindelinOct 6, 2009
  18. Jens LehmannOct 7, 2009
  19. Junio C HamanoOct 7, 2009
  20. Johannes SchindelinOct 7, 2009

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.