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

Re: [PATCH] pack-objects: no crc check when the cached version is used

From
Thomas Rast <trast@inf.ethz.ch>
Date
Sep 13, 2013, 21:26 UTC
Message-ID
<87k3ikct1e.fsf@inf.ethz.ch>
In-Reply-To
<xmqq7gekk24q.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> Current code makes pack-objects always do check_pack_crc() in
>> unpack_entry() even if right after that we find out there's a cached
>> version and pack access is not needed. Swap two code blocks, search
>> for cached version first, then check crc.
[...]
Show 10 quoted lines
>
> Interesting.
>
> This is only triggered inside pack-objects, which would read a lot
> of data from existing packs, and the overhead for looking up the
> entry from the revindex, faulting in the actual packdata, and
> computing and comparing the crc would not be trivial, especially as
> the cost is incurred over many objects we need to untangle in the
> delta chain.  If you have interesting numbers to show how much this
> improves the performance, I am curious to see it.

I can't see anything wrong with the patch, but then I haven't stared too hard. (It seems that my conversion around abe601b (sha1_file: remove recursion in unpack_entry, 2013-03-27) was faithful on this point, the problem has existed for longer than that.)

I tried the perf script below, but at least for the git repo the only thing I can see is noise.

--- 8< --- t/perf/p5300-pack-object.sh --- 8< --- #!/bin/sh

test_description="Tests object packing performance"
. ./perf-lib.sh
test_perf_default_repo
test_perf 'pack-objects on commits in HEAD' '
	git rev-list HEAD |
	git pack-objects --stdout >/dev/null
'
test_perf 'pack-objects on all of HEAD' '
	git rev-list --objects HEAD |
	git pack-objects --stdout >/dev/null
'
test_done
Previous: Junio C HamanoNext: Duy Nguyen
Message 3 of 5 in “pack-objects: no crc check when the cached version is used”
  1. pack-objects: no crc check when the cached version is usedNguyễn Thái Ngọc Duy, Sep 13, 2013
  2. Junio C HamanoSep 13, 2013
  3. Thomas RastSep 13, 2013
  4. Duy NguyenSep 14, 2013
  5. Nicolas PitreSep 14, 2013

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.