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
Mar 27, 2012, 06:31 UTC
Message-ID
<CACsJy8BZVFKZvd1=jz8PoCvTKjX6LorRidJgTxsjFUGfBUai+w@mail.gmail.com>
In-Reply-To
<CAJo=hJsPgUZi2qMc5aDUn0+o5=9n7pBS+yWBASfqtov8WuFBRA@mail.gmail.com>
On Mon, Mar 26, 2012 at 11:08 PM, Shawn Pearce <spearce@spearce.org> wrote:
Show 11 quoted lines
>> [1] http://www.sqlite.org/fileformat2.html
>
> Or use LevelDb[2]. Its BSD license. Uses an immutable file format, but
> writes updates to new smaller files and eventually collapses
> everything back together into a bigger file. This can be a
> dramatically simpler approach than dealing with your own free block
> system inside of a single file. Its only real downside is needing to
> periodically pay a penalty to rewrite the whole index. But this
> rewrite is going to be faster than the time it takes to rewrite the
> pack files for the same repository, which git gc or git repack
> handles. So I don't think its actually a problem for the index.

Cool. I had an experiment with it. A database is created where are keys `git ls-files` on linux-2.6. A few things after the experiment:

 - we need to link to libstdc++.so. I still hope to avoid any new
runtime dependencies
 - I use gettimeofday to time some operations. On linux-2.6,
read_cache() costs 27ms. leveldb_open() alone takes 90ms. Iterating
over all keys takes ~200ms.

Performance wise it does not look very good but maybe I'm just not doing it right.

> [2] http://code.google.com/p/leveldb/
-- 
Duy
Previous: Jeff KingNext: Nguyen Thai Ngoc Duy
Message 20 of 33 in “GSoC - Designing a faster index format”
  1. elton skyMar 20, 2012
  2. Nguyen Thai Ngoc DuyMar 21, 2012
  3. Thomas RastMar 21, 2012
  4. elton skyMar 21, 2012
  5. elton skyMar 22, 2012
  6. Jakub NarebskiMar 23, 2012
  7. Nguyen Thai Ngoc DuyMar 23, 2012
  8. elton skyMar 23, 2012
  9. Nguyen Thai Ngoc DuyMar 23, 2012
  10. Nguyen Thai Ngoc DuyMar 24, 2012
  11. elton skyMar 26, 2012
  12. elton skyMar 26, 2012
  13. Thomas RastMar 26, 2012
  14. Nguyen Thai Ngoc DuyMar 26, 2012
  15. Shawn PearceMar 26, 2012
  16. elton skyMar 27, 2012
  17. David BarrMar 27, 2012
  18. Nguyen Thai Ngoc DuyMar 27, 2012
  19. Jeff KingMar 29, 2012
  20. Nguyen Thai Ngoc DuyMar 27, 2012
  21. Nguyen Thai Ngoc DuyMar 26, 2012
  22. elton skyMar 27, 2012
  23. Nguyen Thai Ngoc DuyMar 27, 2012
  24. elton skyApr 2, 2012
  25. Nguyen Thai Ngoc DuyApr 2, 2012
  26. Shawn PearceApr 2, 2012
  27. Nguyen Thai Ngoc DuyApr 2, 2012
  28. elton skyApr 4, 2012
  29. Nguyen Thai Ngoc DuyApr 4, 2012
  30. elton skyApr 4, 2012
  31. elton skyApr 6, 2012
  32. elton skyApr 6, 2012
  33. elton skyApr 7, 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.