Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-15 Thread Jeff King
On Thu, Sep 15, 2016 at 09:26:22AM -0700, Stefan Beller wrote: > > It may also be possible to really micro-optimize it on some platforms, > > because we know the size in advance (I'd kind of expect the compiler to > > do that, but if we're ending up in glibc memcmp then it sounds like it > > is no

Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-15 Thread Jeff King
On Thu, Sep 15, 2016 at 10:45:34AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > Measuring _just_ the collisions is more like the patch below. In my > > measurements it's more like 30ms, compared to 10s for all of the > > hashcmps. > > > > So we really aren't dealing with collisions, bu

Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-15 Thread Junio C Hamano
Jeff King writes: > Measuring _just_ the collisions is more like the patch below. In my > measurements it's more like 30ms, compared to 10s for all of the > hashcmps. > > So we really aren't dealing with collisions, but rather just verifying > that our hash landed at the right spot. And _any_ dat

Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-15 Thread Stefan Beller
On Wed, Sep 14, 2016 at 11:47 PM, Jeff King wrote: > On Wed, Sep 14, 2016 at 07:01:41PM -0700, Stefan Beller wrote: > >> According to Jeff, sending patches that don't get accepted is the new hype! > > It is what all the cool kids are doing. Unfortunately, it does not save > you from nitpicky revi

Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-15 Thread Jeff King
On Wed, Sep 14, 2016 at 11:47:01PM -0700, Jeff King wrote: > > first = i = hash_obj(sha1, obj_hash_size); > > + clock_gettime(CLOCK_MONOTONIC, &time1); > > while ((obj = obj_hash[i]) != NULL) { > > if (!hashcmp(sha1, obj->oid.hash)) > > break; > > @@ -98,6

Re: [PATCH] object: measure time needed for resolving hash collisions

2016-09-14 Thread Jeff King
On Wed, Sep 14, 2016 at 07:01:41PM -0700, Stefan Beller wrote: > According to Jeff, sending patches that don't get accepted is the new hype! It is what all the cool kids are doing. Unfortunately, it does not save you from nitpicky reviews...;) > first = i = hash_obj(sha1, obj_hash_size);

[PATCH] object: measure time needed for resolving hash collisions

2016-09-14 Thread Stefan Beller
$ time ./git rev-list HEAD --count 44271 print_time_spent_object: measure time needed for resolving hash collisions This shows that we roughly spent a third of the time in resolving hash collisions: I am using linux.git to measure: $ time git rev-list --objects --count HEAD >/dev/null print_time