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

Re: speedup allocation in pack-redundant.c

From
Alex Riesen <raa.lkml@gmail.com>
Date
Nov 23, 2005, 07:31 UTC
Message-ID
<81b0412b0511222331tc43057aqfd942afdebea052c@mail.gmail.com>
In-Reply-To
<4383AFDB.90907@etek.chalmers.se>
On 11/23/05, Lukas Sandström <lukass@etek.chalmers.se> wrote:
Show 23 quoted lines
> >>>>I think making allocation/deallocation to the central place is a
> >>>>good cleanup, but I am not sure about the free-nodes reusing.
> >>>>Does this make difference in real life?
> >>>
> >>>It definitely does, though nor very much. I have no real numbers at
> >>>hand (being home now), but I remember it was 1 min with against 3 min
> >>>without the patch on cygwin+fat32, which is already bad enough all by
> >>>itself. Very big repository with no redundant packs in it.
> >>
> >>Would you mind sharing the .idx files?
> >
> > this time I probably would (they're not here)... But for a perfomance
> > testing any big repository will do, linux kernel, for example.
> >
> The problem is that the large repository I have contains lots of
> redundant packs, which makes quite fast to find a complete set
> and end the search. If you don't have any redundant packs, the
> complete set search really is 2**n (n = the number of packs).
>
> I did some quick experiments with slab allocation and got a 4.4%
> improvement on the redundant repo, so that might be worth persuing.
> (Concept patch below)
>

I don't have the old packs anymore, but I benchmarked all three allocation types anyway:

malloc/free:

$ time git-pack-redundant --all --alt-odb real 0m0.092s user 0m0.108s sys 0m0.015s

simple node reuse (the patch in official tree):

$ time git-pack-redundant --all --alt-odb real 0m0.074s user 0m0.093s sys 0m0.015s

slab node allocation (your concept patch):

$ time git-pack-redundant --all --alt-odb real 0m0.031s user 0m0.046s sys 0m0.015s

This repository has one pack and 17758 files.
Previous: Lukas Sandström
Message 10 of 10 in “speedup allocation in pack-redundant.c”
  1. speedup allocation in pack-redundant.cAlex Riesen, Nov 22, 2005
  2. Junio C HamanoNov 22, 2005
  3. Lukas SandströmNov 22, 2005
  4. Junio C HamanoNov 22, 2005
  5. Alex RiesenNov 22, 2005
  6. Alex RiesenNov 22, 2005
  7. Lukas SandströmNov 22, 2005
  8. Alex RiesenNov 22, 2005
  9. Lukas SandströmNov 22, 2005
  10. Alex RiesenNov 23, 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.