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

[PATCH] read-cache: call verify_hdr() in a background thread

From
Ggit@jeffhostetler.com <git@jeffhostetler.com>
Date
Mar 24, 2017, 13:27 UTC
Message-ID
<1490362071-46932-1-git-send-email-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>

This patch contains a performance optimization to run verify_hdr() in a background thread while the foreground thread parses the index. This allows do_read_index() to complete faster.

This idea was recently discussed on the mailing list in: https://public-inbox.org/git/85221b97-759f-b7a9-1256-21515d163cbf@jeffhostetler.com/ during a discussion on sha1dc.

Our testing on Windows showed that verifying the SHA1 hash on the index file takes approximately the same amount of time as parsing the file and building the array of cache_entries. (It could also be that having 2 threads better ammortizes the page faults of reading from the mmap'd file.)

An earlier version of this change has been in use in GfW since December: https://github.com/git-for-windows/git/pull/978

Jeff Hostetler (1):
  read-cache: call verify_hdr() in a background thread
 read-cache.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 86 insertions(+), 1 deletion(-)
-- 
2.7.4
Next: git@jeffhostetler.com
Message 1 of 7 in “read-cache: call verify_hdr() in a background thread”
  1. read-cache: call verify_hdr() in a background threadgit@jeffhostetler.com, Mar 24, 2017
  2. read-cache: call verify_hdr() in a background threadgit@jeffhostetler.com, Mar 24, 2017
  3. Jeff KingMar 24, 2017
  4. Jeff HostetlerMar 24, 2017
  5. Jonathan NiederMar 24, 2017
  6. Jeff HostetlerMar 24, 2017
  7. Jonathan NiederMar 24, 2017

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.