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

Re: [StGit PATCH] Read several objects at once with git cat-file --batch

From
Karl Hasselström <kha@treskal.com>
Date
Aug 10, 2008, 23:58 UTC
Message-ID
<20080810235845.GA5106@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0808101525w1e6f1e60h162a4b137d6dca6c@mail.gmail.com>
On 2008-08-10 23:25:08 +0100, Catalin Marinas wrote:
Show 11 quoted lines
> 2008/8/8 Karl Hasselström <kha@treskal.com>:
>
> > Instead of spawning a separate cat-file process for every blob and
> > commit we want to read. This speeds things up slightly: about 6-8%
> > when uncommitting and rebasing 1470 linux-kernel patches
> > (perftest.py rebase-newrebase-add-file-linux).
>
> Which version of Git got the --batch option to git-cat-file? It
> might be possible that default Git in Debian (testing) or Ubuntu
> doesn't have this option. Maybe we could still have the original
> behaviour as a fallback.

Hmm, I never realized it was so new. It's not in any 1.5.5 release, but it is in 1.5.6-rc0. So realistically, we'll have to require version 1.5.6 for this. (The patch should add a paragraph about the required git version to some doc file.)

A fallback is certainly conceivable. The only nontrivial thing about it would be to detect when it's necessary. And to make sure both code paths are tested ...

(I have a similar patch that uses diff-tree --stdin, but that needs a git with the patches I posted some hours ago.)

> Otherwise, the patch looks allright. It took me a bit of time to see
> why we need the new run_background() function (but in my current
> Git, 1.5.3.4.206.g58ba4, there wasn't such an option; I had to
> upgrade).

Thanks. I'm not 100% pleased with the background running stuff yet. It works, but could use some refactoring so that callers don't have to know too much.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 4 of 7 in “[StGit] kha/{safe,experimental} updated”
  1. Karl HasselströmAug 8, 2008
  2. Read several objects at once with git cat-file --batchKarl Hasselström, Aug 8, 2008
  3. Catalin MarinasAug 10, 2008
  4. Karl HasselströmAug 10, 2008
  5. Catalin MarinasAug 13, 2008
  6. Karl HasselströmAug 17, 2008
  7. Catalin MarinasAug 21, 2008

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.