Trivial (and small) exclude optimizations
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | match_pathname: avoid calling strncmp if baselen is 0dir.c | +1 | 1 reply | |
| 2/3 | dir.c: inline convenient *_icase helpersdir.c dir.h | +15 | 0 replies | |
| 3/3 | match_basename: use strncmp instead of strcmpattr.c dir.c | +7 | 3 replies |
Reviews trailers per patch
None of the 3 patches has a Reviewed-by or Acked-by.
| Patch | Karsten Blees |
|---|---|
| Series | Tracked-down-by |
| 1/3 | |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] Trivial (and small) exclude optimizations
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(-)
Signature · 1 line
1.8.1.2.536.gf441e6d