From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Jeff King" <peff@peff.net>, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH WIP 0/3] top-level gitignore considered less harmful
Date: Sat, 26 May 2012 19:31:11 +0700 [thread overview]
Message-ID: <1338035474-4346-1-git-send-email-pclouds@gmail.com> (raw)
While my mind is still fresh on exclude stuff, let's do something
to improve the big top-level gitignore situation [1].
The last patch is the real meat, where it assumes caller calls it on a
series of pathnames of the same dirname. It'll cache strcmp result of
the dirname part so we only pay the cost once per pattern for all
entries in the same directory.
The result is not so impressive (i'm on -O0 though). Old webkit.git,
before:
real 0m6.418s
user 0m5.561s
sys 0m0.827s
after:
real 0m5.262s
user 0m4.407s
sys 0m0.850s
We could approach the problem a different way instead: push back as
much dirname as possible back to "(struct exclude*)->base", but I'm
afraid that may mess thing up with all the pushing/popping in
prep_exclude.
Also about that, we should not need to call prep_exclude() on every
pathname, at least when the caller is {fill,read}_directory().
There's another optimaztion we could do to pay even less. If users
sort the exclude patterns, if we check dirname of one pattern and the
next pattern shares the same dirname, skip comparing what we have
compared again.
The same can be done on "base" (even easier because we can just
compare base pointer to know if they are the same) but "base" is for
non-top-level gitignore.
[1] http://thread.gmane.org/gmane.comp.version-control.git/194294
Nguyễn Thái Ngọc Duy (3):
Unindent excluded_from_list()
exclude: do strcmp as much as possible before fnmatch
exclude: reduce computation cost on checking dirname in patterns
dir.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++--------------------
dir.h | 5 +-
2 files changed, 120 insertions(+), 51 deletions(-)
--
1.7.10.2.549.g9354186
next reply other threads:[~2012-05-26 12:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-26 12:31 Nguyễn Thái Ngọc Duy [this message]
2012-05-26 12:31 ` [PATCH 1/3] Unindent excluded_from_list() Nguyễn Thái Ngọc Duy
2012-05-26 12:31 ` [PATCH 2/3] exclude: do strcmp as much as possible before fnmatch Nguyễn Thái Ngọc Duy
2012-05-27 6:51 ` Junio C Hamano
2012-05-27 12:06 ` Nguyen Thai Ngoc Duy
2012-05-27 18:14 ` Junio C Hamano
2012-05-28 1:03 ` Nguyen Thai Ngoc Duy
2012-05-28 5:02 ` Junio C Hamano
2012-05-29 18:03 ` Junio C Hamano
2012-05-29 18:21 ` Thiago Farina
2012-05-26 12:31 ` [PATCH 3/3] exclude: reduce computation cost on checking dirname in patterns Nguyễn Thái Ngọc Duy
2012-05-26 13:25 ` [PATCH WIP 0/3] top-level gitignore considered less harmful Nguyen Thai Ngoc Duy
2012-05-26 21:45 ` Jeff King
2012-05-27 3:45 ` Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1338035474-4346-1-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).