Re: [PATCH v2 3/4] Speed up is_git_command() by checking early for internal commands

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Thu, Jan 02, 2014 at 11:41:05AM -0800, Junio C Hamano wrote:
>
>>  - builtin/merge.c is the same, but it is conceptually even worse.
>>    It has the end-user supplied string and wants to see if it is a
>>    valid strategy.  If the user wants to use a custom strategy, a
>>    single stat() to make sure if it exists should suffice, and the
>>    error codepath should load the command list to present the names
>>    of available ones in the error message.
>
> Is it a single stat()? I think we would need to check each element of
> $PATH. 

Yeah, load_command_list() iterates over the members of env_path.

> Though in practice, the exec-dir would be the first thing we
> check, and where we would find the majority of hits. So it would still
> be a win, as we would avoid touching anything but the exec-dir in the
> common case.

Exactly.
--
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]