From: Alex Riesen <raa.lkml@gmail.com>
To: Dmitry Potapov <dpotapov@gmail.com>
Cc: Johannes Sixt <j.sixt@viscovery.net>,
Joshua Juran <jjuran@gmail.com>,
Giovanni Funchal <gafunchal@gmail.com>,
git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH v2] correct verify_path for Windows
Date: Sun, 12 Oct 2008 20:18:36 +0200 [thread overview]
Message-ID: <20081012181836.GA10626@steel.home> (raw)
In-Reply-To: <20081012135048.GC21650@dpotapov.dyndns.org>
Dmitry Potapov, Sun, Oct 12, 2008 15:50:48 +0200:
> On Sun, Oct 12, 2008 at 12:58:52AM +0200, Alex Riesen wrote:
> > 2008/10/11 Dmitry Potapov <dpotapov@gmail.com>:
> > >> > + /* On Windows, file names are case-insensitive */
> > >> > + case 'G':
> > >> > + if ((rest[1]|0x20) != 'i')
> > >> > + break;
> > >> > + if ((rest[2]|0x20) != 't')
> > >> > + break;
> > >>
> > >> We have tolower().
> > >
> > > I am aware of that, but I am not sure what we gain by using it. It seems
> > > it makes only code bigger and slow.
> >
> > It does? Care to look into git-compat-util.h?
>
> As a matter of fact, I did, and I see the following:
>
> #define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
> #define tolower(x) sane_case((unsigned char)(x), 0x20)
>
> static inline int sane_case(int x, int high)
> {
> if (sane_istest(x, GIT_ALPHA))
> x = (x & ~0x20) | high;
> return x;
> }
>
> So, it looks like an extra look up and an extra comparison here.
Does not look like much more code. But:
> > BTW, is it such a critical path?
>
> I am not sure whether it is critical or not. It is called for each
> name in path. So, if you have a long path, it may be called quite a
> few times per a single path. Also, some operation such 'git add' can
> call verify_path() more than once (IIRC, it was called thrice per each
> added file). But I have no numbers to tell whether it is noticeable or
> not.
I looked at the callers (briefly). Performance could be a problem: add
and checkout can work with real big file lists and long pathnames.
So ok, than. It is critical.
next prev parent reply other threads:[~2008-10-12 18:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 14:02 Files with colons under Cygwin Giovanni Funchal
2008-10-04 23:39 ` Dmitry Potapov
2008-10-05 9:04 ` Alex Riesen
2008-10-05 9:14 ` Alex Riesen
2008-10-05 19:51 ` Dmitry Potapov
2008-10-05 9:28 ` Giovanni Funchal
2008-10-06 6:54 ` Johannes Sixt
2008-10-07 0:53 ` Dmitry Potapov
2008-10-07 6:13 ` Johannes Sixt
2008-10-07 2:05 ` Joshua Juran
2008-10-07 3:26 ` [PATCH v2] correct verify_path for Windows Dmitry Potapov
2008-10-07 6:18 ` Johannes Sixt
2008-10-11 16:33 ` Dmitry Potapov
2008-10-11 22:58 ` Alex Riesen
2008-10-12 13:50 ` Dmitry Potapov
2008-10-12 18:18 ` Alex Riesen [this message]
2008-10-13 6:00 ` Johannes Sixt
2008-10-13 6:18 ` Alex Riesen
2008-10-07 6:25 ` Alex Riesen
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=20081012181836.GA10626@steel.home \
--to=raa.lkml@gmail.com \
--cc=dpotapov@gmail.com \
--cc=gafunchal@gmail.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=jjuran@gmail.com \
--cc=spearce@spearce.org \
/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).