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

Re: [PATCH] allow git-bundle to create bottomless bundle

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Aug 9, 2007, 12:32 UTC
Message-ID
<30e4a070708090532y4d5f8528q8458fb5d28c980eb@mail.gmail.com>
In-Reply-To
<7v643pz4c9.fsf@assigned-by-dhcp.cox.net>
On 8/9/07, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> Mark Levedahl <mlevedahl@gmail.com> writes:
>
> > Junio C Hamano wrote:
>
> Actually, there is another bug nearby.
>

Curious... I did a long time ago get git-bundle.sh to write out the format Dscho finally implemented working in Linux and Cygwin. With your latest patch, both produce identical bundles for a number of cases, but the timing is very curious:

*builtin*
git>time git-bundle create foo refs/tags/v1.0.3
Generating pack...
Done counting 12288 objects.
Deltifying 12288 objects...
 100% (12288/12288) done
Writing 12288 objects...
 100% (12288/12288) done
Total 12288 (delta 8435), reused 11542 (delta 7961)

real 0m41.953s user 0m5.060s sys 0m39.685s

*shell script*
git>time git-bundle2 create foo2 refs/tags/v1.0.3
Generating pack...
Done counting 12288 objects.
Deltifying 12288 objects...
 100% (12288/12288) done
Total 12288 (delta 8435), reused 11542 (delta 7961)
Created foo2

real 0m2.453s user 0m1.842s sys 0m1.190s git>diff foo foo2 git>

Since when is shell 20 times faster than a builtin? Ok, those results are on Cygwin. On Linux, I get 1.21 sec for the builtin vs 0.933 for the shell script. Not as dramatic, but the script is still faster. So, I think this qualifies as a bug. I'm attaching the script (for info only, I'm not suggesting to replace the builtin), as I can't usefully put it inline from gmail.

The timing difference seem to be in the rev walking (by eyeball, packfile generation time is the same), so something the shell script is doing to get the rev list is obviously more efficient than how the builtin works for this case.

Mark
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 10 of 11 in “resumable git-clone?”
  1. Nguyen Thai Ngoc DuyAug 7, 2007
  2. Shawn O. PearceAug 8, 2007
  3. Johannes SchindelinAug 8, 2007
  4. Junio C HamanoAug 8, 2007
  5. Johannes SchindelinAug 8, 2007
  6. allow git-bundle to create bottomless bundleJunio C Hamano, Aug 9, 2007
  7. Johannes SchindelinAug 9, 2007
  8. Mark LevedahlAug 9, 2007
  9. Junio C HamanoAug 9, 2007
  10. Mark LevedahlAug 9, 2007
  11. Nguyen Thai Ngoc DuyAug 8, 2007

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.