Re: [PATCH 08/12] add oidset API

2017-01-24 Thread Jeff King
On Tue, Jan 24, 2017 at 08:26:40PM +, Ramsay Jones wrote: > > +++ b/oidset.c > > @@ -0,0 +1,49 @@ > > +#include "cache.h" > > +#include "oidset.h" > > + > > +struct oidset_entry { > > + struct hashmap_entry hash; > > + struct object_id oid; > > +}; > > + > > +int oidset_hashcmp(const void

Re: [PATCH 08/12] add oidset API

2017-01-24 Thread Ramsay Jones
On 24/01/17 00:46, Jeff King wrote: > This is similar to many of our uses of sha1-array, but it > overcomes one limitation of a sha1-array: when you are > de-duplicating a large input with relatively few unique > entries, sha1-array uses 20 bytes per non-unique entry. > Whereas this set will use

[PATCH 08/12] add oidset API

2017-01-23 Thread Jeff King
This is similar to many of our uses of sha1-array, but it overcomes one limitation of a sha1-array: when you are de-duplicating a large input with relatively few unique entries, sha1-array uses 20 bytes per non-unique entry. Whereas this set will use memory linear in the number of unique entries