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

[POC PATCH 0/5] Threaded loose object and pack access

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 9, 2011, 08:39 UTC
Message-ID
<cover.1323419666.git.trast@student.ethz.ch>

Well, just to make sure we're all left in a confused mess of partly conflicting patches, here's another angle on the same thing:

Jeff King wrote:
> Wow, that's horrible. Leaving aside the parallelism, it's just terrible
> that reading from the cache is 20 times slower than the worktree. I get
> similar results on my quad-core machine.

By poking around in sha1_file.c I got that down to about 10. It's not great yet, but it seems a start.

The goal would be to improve it to the point where a patch lookup that already has all relevant packs open and windows mapped can proceed without locking. I'm not sure that's doable short of duplicating the whole pack state (including fds and windows) across threads, but I'll give it some more thought before going that route.

Thomas Rast (5):
  Turn grep's use_threads into a global flag
  grep: push locking into read_sha1_*
  sha1_file_name_buf(): sha1_file_name in caller's buffer
  sha1_file: stuff various pack reading variables into a struct
  sha1_file: make the pack machinery thread-safe
 builtin/grep.c   |   60 +++++-----------
 cache.h          |    1 +
 replace_object.c |    5 +-
 sha1_file.c      |  213 +++++++++++++++++++++++++++++++++++++++++-------------
 thread-utils.c   |   30 ++++++++
 thread-utils.h   |   23 ++++++
 6 files changed, 240 insertions(+), 92 deletions(-)
-- 
1.7.8.431.g2abf2
Next: Thomas Rast
Message 1 of 11 in “Threaded loose object and pack access”
  1. 0/5 Threaded loose object and pack accessThomas Rast, Dec 9, 2011
  2. 1/5 Turn grep's use_threads into a global flagThomas Rast, Dec 9, 2011
  3. 2/5 grep: push locking into read_sha1_*Thomas Rast, Dec 9, 2011
  4. 3/5 sha1_file_name_buf(): sha1_file_name in caller's bufferThomas Rast, Dec 9, 2011
  5. 4/5 sha1_file: stuff various pack reading variables into a structThomas Rast, Dec 9, 2011
  6. 5/5 sha1_file: make the pack machinery thread-safeThomas Rast, Dec 9, 2011
  7. Nguyen Thai Ngoc DuyApr 9, 2012
  8. Thomas RastApr 10, 2012
  9. Nguyen Thai Ngoc DuyApr 10, 2012
  10. Thomas RastDec 9, 2011
  11. Nguyen Thai Ngoc DuyDec 10, 2011

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.