Re: [PATCH] fix overslow :/no-such-string-ever-existed diagnostics

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> On my box, the command spends ~1.8 seconds without the patch to make the
> report; with the patch it spends ~1.12 seconds.

Nice improvement.

>  * Yes, we often say "this is an error path and paying the price in
>    performance for a better diagnosis is worth", and it is correct.
>    But it is not an excuse to spend unnecessary cycles.

Right. When I introduced the second call with gently=0, I was thinking
of cases where the function is fast, but :/blah has to walk through
history, and we don't want that twice (especially since the conclusion
is to give generic and not-so-helpfull message!).

>    We may want to add a guard at the beginning of die_verify_filename() to
>    omit the extra call to get_sha1_with_mode_1(only_to_die=1) when arg
>    looks like a magic pathspec, i.e. ":" followed by anything !isalnum().

Is this a complement or an alternative? It seems to me that your other
patch makes this first one useless (in the sense that the second call is
always cheap), and avoids complexifying the code of get_sha1_with_mode_1
for the first call.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]