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

Re: reftable: new ref storage format

From
EWEric Wong <e@80x24.org>
Date
Jul 13, 2017, 21:51 UTC
Message-ID
<20170713215147.GA31153@starla>
In-Reply-To
<20170713203533.vcfyf5iei46g4tcf@sigill.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
> I agree that a full binary search of a reftable is harder because of the
> prefix compression (it may still be possible by scanning backwards, but
> I think there are ambiguities when you land in the middle of a record,
> since there's no unambiguous end-of-record character). But I don't think
> it matters. If you binary-search to a constant-sized block, then a
> linear scan of the block is acceptable.

For a new packed-refs, I think an intrusive critbit tree would be a good way to store refs which have many common prefixes and I've always wanted to apply critbit to an on-disk storage format...

Several years ago, I started writing one in Perl using pwrite/pread to provide Message-ID <=> NNTP article number mapping several years ago, but gave up on it out of laziness:

  https://80x24.org/spew/1441508596-19511-1-git-send-email-e@80x24.org/raw

The end goal would've been to have two tries sharing the same storage struct: one keyed by Message-ID, the other keyed by NNTP article number (and figuring out the node using offsets like we do with (container_of|list_entry) in list.h.

For git, being able to do an O(hashlength) prefix search based on the object_id from the reftable would speed up decorations, I think. And of course, the O(refnamelength) prefix search would also apply to the refnames themselves.

Previous: Jeff KingNext: Shawn Pearce
Message 5 of 25 in “reftable: new ref storage format”
  1. Shawn PearceJul 13, 2017
  2. Jeff KingJul 13, 2017
  3. Stefan BellerJul 13, 2017
  4. Jeff KingJul 13, 2017
  5. Eric WongJul 13, 2017
  6. Shawn PearceJul 14, 2017
  7. Jeff KingJul 14, 2017
  8. Shawn PearceJul 14, 2017
  9. Dave BorowitzJul 14, 2017
  10. Shawn PearceJul 14, 2017
  11. Jeff KingJul 14, 2017
  12. Shawn PearceJul 16, 2017
  13. Jeff KingJul 16, 2017
  14. Johannes SixtJul 16, 2017
  15. Jeff KingJul 16, 2017
  16. Johannes SixtJul 16, 2017
  17. Michael HaggertyJul 16, 2017
  18. Shawn PearceJul 16, 2017
  19. Shawn PearceJul 16, 2017
  20. Dave BorowitzJul 16, 2017
  21. Shawn PearceJul 16, 2017
  22. Michael HaggertyJul 18, 2017
  23. Junio C HamanoJul 18, 2017
  24. Shawn PearceJul 23, 2017
  25. Shawn PearceJul 23, 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.