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

Re: [PATCH v2] csum-file: make hashwrite() more readable

From
Jeff King <peff@peff.net>
Date
Mar 28, 2021, 08:38 UTC
Message-ID
<YGBAm9qNdn4elbKF@coredump.intra.peff.net>
In-Reply-To
<pull.914.v2.git.1616762291574.gitgitgadget@gmail.com>
On Fri, Mar 26, 2021 at 12:38:11PM +0000, Derrick Stolee via GitGitGadget wrote:
Show 7 quoted lines
> However, during this investigation, I inspected hashwrite() and
> misunderstood it, even after looking closely and trying to make it
> faster. This change simply reorganizes some parts of the loop within
> hashwrite() to make it clear that each batch either uses memcpy() to the
> hashfile's buffer or writes directly from the input buffer. The previous
> code relied on indirection through local variables and essentially
> inlined the implementation of hashflush() to reduce lines of code.

Thanks, I think this nicely argues for the change here (and I agree the result, especially with the comments, is much easier to understand).

-Peff
Previous: Junio C Hamano
Message 8 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.