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

Re: [GSoC] Designing a faster index format

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Apr 3, 2012, 12:28 UTC
Message-ID
<CACsJy8AbRsVq0b=K+=vqfpQOMuduNBDwignfAiiV+cvpFeS3jQ@mail.gmail.com>
In-Reply-To
<4F7ABA19.7040408@alum.mit.edu>
On Tue, Apr 3, 2012 at 3:51 PM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 7 quoted lines
>> -- Proposed solution --
>> The proposed solution is to redesign the index to a B-tree based format. This
>> allows changes to the index in O(log(n)) time, with n being the number of
>> entries in the index.
>
> I thought that the index lock currently only blocks writers, not readers
> (am I wrong?).
I think you are right.
Show 16 quoted lines
> So given that you want to be able to mutate the index
> file without rewriting the whole file, it seems to me that you have to
> pick from one of these alternatives:
>
> 1. Change the locking semantics so that readers also block when the file
> is locked.  This choice would have some important consequences: (a)
> readers will also have to obtain a lock before starting to read.  (b) to
> avoid deadlock, it will become crucial that the lock is never held
> across the execution of any other git (sub-)commands that might want to
> read the index.
>
> 2. Implement a file format that can be read even while it is being
> mutated.  If so, please explain the data file format in more detail; in
> particular, how do you plan to mutate the file in a way that does not
> disturb readers?  How do you plan to read the whole index efficiently (I
> imagine that reading the whole index will remain a frequent operation)?
Copy-on-write B-trees, aka btrfs. Does anybody like to go that route ;)
Show 7 quoted lines
> I encourage you to include an analysis of the number of disk seeks when
> you are analyzing the cost of read/write operations on the index.  This
> will have a strong effect on the time for working with the index when
> the disk cache is cold.  The current index requires O(1) seeks for
> reading and writing, which I believe is a big part of the reason that
> the current read-the-whole-index/write-the-whole-index design performs
> excellently despite the amount of data that it is touching.
-- 
Duy
Previous: Michael HaggertyNext: Thomas Gummerer
Message 20 of 36 in “[GSoC] Designing a faster index format”
  1. Thomas GummererMar 20, 2012
  2. Nguyen Thai Ngoc DuyMar 21, 2012
  3. Thomas GummererMar 21, 2012
  4. Nguyen Thai Ngoc DuyMar 21, 2012
  5. Thomas RastMar 21, 2012
  6. Thomas GummererMar 21, 2012
  7. Thomas RastMar 21, 2012
  8. Thomas GummererMar 22, 2012
  9. Thomas RastMar 23, 2012
  10. Thomas GummererMar 25, 2012
  11. Thomas GummererMar 26, 2012
  12. Junio C HamanoMar 26, 2012
  13. Thomas GummererMar 27, 2012
  14. Thomas RastMar 27, 2012
  15. Thomas GummererMar 29, 2012
  16. Junio C HamanoMar 29, 2012
  17. Nguyen Thai Ngoc DuyMar 30, 2012
  18. Thomas GummererApr 2, 2012
  19. Michael HaggertyApr 3, 2012
  20. Nguyen Thai Ngoc DuyApr 3, 2012
  21. Thomas GummererApr 3, 2012
  22. david@lang.hmApr 3, 2012
  23. Thomas GummererApr 4, 2012
  24. Noel GrandinApr 5, 2012
  25. Thomas RastApr 5, 2012
  26. Shawn PearceApr 6, 2012
  27. Nguyen Thai Ngoc DuyApr 6, 2012
  28. Thomas RastApr 6, 2012
  29. Nguyen Thai Ngoc DuyApr 6, 2012
  30. Shawn PearceApr 6, 2012
  31. Nguyen Thai Ngoc DuyApr 6, 2012
  32. Shawn PearceApr 6, 2012
  33. Michael HaggertyApr 5, 2012
  34. Nguyen Thai Ngoc DuyMar 21, 2012
  35. Nguyen Thai Ngoc DuyApr 19, 2012
  36. Jeff KingApr 20, 2012

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.