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

Re: fix git-pack-redundant crashing sometimes

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 15, 2005, 17:28 UTC
Message-ID
<Pine.LNX.4.64.0511150921420.3945@g5.osdl.org>
In-Reply-To
<81b0412b0511150811w2a7a2c4ft9a2920ac4f030ee4@mail.gmail.com>
On Tue, 15 Nov 2005, Alex Riesen wrote:
Show 7 quoted lines
> On 11/15/05, Timo Hirvonen <tihirvon@gmail.com> wrote:
> > > The code could profit from double-linked lists greatly, IMHO.
> >
> > I use list.h from Linux when I need double-linked lists.  It is very
> > easy to use, efficient and fast.
> 
> Yes, I had it in mind, too.

There's a "ptrlist" implementation in sparse, which does a very space-efficient implementation of arbitrary lists of pointers. It's also very CPU-efficient (in fact, thanks to being very cache-friendly, more so than the kernel list.h implementation) for most well-behaved operations (ie it's not hugely friendly to removal, but it's great for "add to end" and "traverse the list").

The ptrlist implementation is optimized for cases where the lists are usually shortish, but not trivial. So they are worthwhile if you expect the list length to be on the order of 5-10 entries rather than just 1-2 (if you have just a couple of entries, the kernel lists are better). But perhaps more importantly, they are very space-efficient when the lists grow bigger (ie they average to just about 5% over the memory cost of a single pointer per list element for long lists).

Sparse in general is under the OSL license, but I'll happily dual-license the ptrlist thing, it's trivial and all my code (and I already checked with the person who did the list sorting code that we can dual-license that too).

			Linus
Previous: Alex RiesenNext: Lukas Sandström
Message 4 of 21 in “fix git-pack-redundant crashing sometimes”
  1. Alex RiesenNov 15, 2005
  2. Timo HirvonenNov 15, 2005
  3. Alex RiesenNov 15, 2005
  4. Linus TorvaldsNov 15, 2005
  5. Lukas SandströmNov 15, 2005
  6. Fix llist_sorted_difference_inplace in git-pack-redundantLukas Sandström, Nov 15, 2005
  7. Alex RiesenNov 15, 2005
  8. Lukas SandströmNov 15, 2005
  9. Alex RiesenNov 15, 2005
  10. Lukas SandströmNov 15, 2005
  11. Alex RiesenNov 16, 2005
  12. Alex RiesenNov 16, 2005
  13. Linus TorvaldsNov 15, 2005
  14. Junio C HamanoNov 16, 2005
  15. Lukas SandströmNov 16, 2005
  16. Lukas SandströmNov 16, 2005
  17. Matthias UrlichsNov 17, 2005
  18. Fredrik KuivinenNov 17, 2005
  19. Make git-pack-redundant non-horribly slow on large sets of packsLukas Sandström, Nov 17, 2005
  20. Fix bug introduced by the latest changes to git-pack-redundantLukas Sandström, Nov 18, 2005
  21. Fix a bug in get_all_permutations.Lukas Sandström, Nov 18, 2005

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.