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

Re: [PATCH] diff-delta.c: pack the index structure

From
Nicolas Pitre <nico@cam.org>
Date
Sep 8, 2007, 02:34 UTC
Message-ID
<alpine.LFD.0.9999.0709072215420.21186@xanadu.home>
In-Reply-To
<85fy1q11xv.fsf@lola.goethe.zz>
On Sat, 8 Sep 2007, David Kastrup wrote:
> In normal use cases, the performance wins are not overly impressive:
> we get something like 5-10% due to the slightly better locality of
> memory accesses using the packed structure.

The gain is probably counterbalanced by the fact that you're copying the whole index when packing it, which is unfortunate.

Also, could you provide actual test results backing your performance claim? 5-10% is still not negligible.

> -	struct index_entry *entry, **hash;
> +	struct unpacked_index_entry *entry, **hash;
> +	struct index_entry *aentry, **ahash;
What does the "a" stand for?
> +	mem = index+1;
[...]
> +	for (i=0; i<hsize; i++) {
[...]
> +		for (entry=hash[i]; entry; entry=entry->next)

Minor style nit: please add spaces around "+", "=", "<", etc. for consistency.

Otherwise that looks fine to me.
Nicolas
Previous: David KastrupNext: David Kastrup
Message 2 of 5 in “diff-delta.c: pack the index structure”
  1. diff-delta.c: pack the index structureDavid Kastrup, Sep 7, 2007
  2. Nicolas PitreSep 8, 2007
  3. David KastrupSep 8, 2007
  4. David KastrupSep 8, 2007
  5. David KastrupSep 8, 2007

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.