Re: [PATCH] process_{tree,blob}: Remove useless xstrdup calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sat, 11 Apr 2009, Björn Steinbrink wrote:
> 
> No, this is x86-64, 8 byte pointers. But the savings are trivially
> explained I think. The struct object_array things are 20 bytes here (per
> object overhead!), so that's about 5M * 20 = 100M. And the average name
> length for the objects was 19 bytes, which means about another 100M.
> Both, the object_array stuff as well as the path names, were allocated
> and never freed. Your patch removed the object_array stuff, and it made
> the memory allocations for the names temporary. Right?

Right.

My original one-liner patch just did the name freeing part, but it did so 
only at the _end_ (when actually calling show_object()), so it probably 
didn't help RSS very much - because you still had one point in time where 
you had all the names allocated. It probably helped packing (since it 
allocates more _afterwards_), but likely didn't make much of a difference 
for just 'git rev-list".

So that was the impetus for trying to just avoid the "keep all objects 
around on the 'object_array' thing" patch, and then cleaning up the 
show_object() call semantics.

		Linus
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]