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

Re: [PATCH] csum-file: flush less often

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2021, 18:52 UTC
Message-ID
<xmqq4kgzvzf6.fsf@gitster.g>
In-Reply-To
<xmqq8s6bvzpf.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
>> So, I'm of two minds here:
>>
>>  1. This is embarassing. I wasted everyone's time for nothing. I can retract
>>     this patch.
>>
>>  2. This is embarassing. I overstated the problem here. But we might be able
>>     to eke out a tiny performance boost here.
>>
>> I'm open to either. I think we should default to dropping this patch unless
>> someone thinks the rewrite above is a better organization of the logic. (I
>> can then send a v2 including that version and an updated commit message.)
>
> 3. The current code around "if (nr == sizeof(f->buffer))" might be a
>    bit too clever for readers who try to understand what is going
>    on, and the whole "while" loop may deserve a comment based on
>    what you wrote before your replacement implementation.

Having said all that, comparing the original and the version updated with your "flush less often" patch, I find the latter quite easier to read, so as long as the update does not give us 1% slowdown, it may be worth adopting for the readability improvement alone.

Of course, if we were to go that route, the sales pitch in the log message needs to be updated.

Thanks.
Previous: Junio C HamanoNext: Jeff King
Message 4 of 8 in “csum-file: flush less often”
  1. csum-file: flush less oftenDerrick Stolee via GitGitGadget, Mar 24, 2021
  2. Derrick StoleeMar 25, 2021
  3. Junio C HamanoMar 25, 2021
  4. Junio C HamanoMar 25, 2021
  5. Jeff KingMar 26, 2021
  6. csum-file: make hashwrite() more readableDerrick Stolee via GitGitGadget, Mar 26, 2021
  7. Junio C HamanoMar 26, 2021
  8. Jeff KingMar 28, 2021

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.