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

Re: [PATCH 2/3] read-cache: read on-disk entries in byte order

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2022, 15:47 UTC
Message-ID
<xmqqczbep4hf.fsf@gitster.g>
In-Reply-To
<YzWBEoRkCmbUkIs8@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> On Wed, Sep 28, 2022 at 12:21:15AM -0400, Jeff King wrote:
>
>> The downside is that we're copying the data an extra time. It's not very
>> much data, and it's all fixed size, so the compiler should be able to do
>> a reasonable job of optimizing here. But I didn't time the potential
>> impact.
> ...
>   Summary
>     './test-tool.old read-cache 1000' ran
>       1.11 ± 0.04 times faster than './test-tool.new read-cache 1000'
>
> I think that's probably the nail in the coffin for my proposed approach.
> To be fair, it's only .3ms extra for a normal program which reads the
> index once. That's not that big in absolute numbers. But there are
> larger index files in the wild. And the improvement in simplicity and
> readability is simply not that great.

Thanks for the due diligence. This result may be an indication of how efficient the existing code is, but it is a bit surprising that one more copy of the stat_data struct makes that much difference.

Previous: Jeff KingNext: Jeff King
Message 7 of 11 in “What's cooking in git.git (Sep 2022, #08; Tue, 27)”
  1. Junio C HamanoSep 27, 2022
  2. Victoria DyeSep 28, 2022
  3. vd/fix-unaligned-read-index-v4, was Re: What's cooking in git.git (Sep 2022, #08; Tue, 27)Jeff King, Sep 28, 2022
  4. 1/3 pack-bitmap: make read_be32() publicJeff King, Sep 28, 2022
  5. 2/3 read-cache: read on-disk entries in byte orderJeff King, Sep 28, 2022
  6. Jeff KingSep 29, 2022
  7. Junio C HamanoSep 29, 2022
  8. 3/3 read-cache: use read_be32() in create_from_disk()Jeff King, Sep 28, 2022
  9. Junio C HamanoSep 28, 2022
  10. Ævar Arnfjörð BjarmasonSep 28, 2022
  11. Junio C HamanoSep 28, 2022

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.