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