I've been examining how and where str*cmp are called by read_directory(). They are presumably where most of the time is spent. The gain is not big, but still worth it, I think. These are tested without nd/read-directory-recursive-optim. The saving is probably smaller as nd/read... cuts down a big number of entries to be processed by exclude machinery. There is another optimization window, which a simple hack suggests it may shave 100ms out of 500ms ls-files time on my machine. Say you have "/INSTALL" in your root .gitignore. The pattern will be tested for _all_ pathnames including "path/deep/down/here". By limiting the pattern to pathnames of the same directory level, the number of applicable pathnames to the pattern will be usually small and limited (otherwise as the repository grows with more pathnames, we pay more for exclude). Haven't figured out how to save directory level yet though. Nguyễn Thái Ngọc Duy (3): match_pathname: avoid calling strncmp if baselen is 0 dir.c: inline convenient *_icase helpers match_basename: use strncmp instead of strcmp attr.c | 2 ++ dir.c | 26 ++++++-------------------- dir.h | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 23 deletions(-) -- 1.8.1.2.536.gf441e6d -- 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