From: Fredrik Kuivinen <frekui@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/5] Speed up string search routines
Date: Sun, 14 Feb 2010 17:47:05 +0100 [thread overview]
Message-ID: <4c8ef71002140847i19b64b21ocfa71658a49d97b5@mail.gmail.com> (raw)
In-Reply-To: <7vk4uhklxm.fsf@alter.siamese.dyndns.org>
On Sat, Feb 13, 2010 at 19:52, Junio C Hamano <gitster@pobox.com> wrote:
> Fredrik Kuivinen <frekui@gmail.com> writes:
>
> It needs to be a bit more friendly to readers of "git log" and
> ReleaseNotes by hinting why use of kwset is beneficial (e.g. "use kwset
> instead of memmem to find fixed string more efficiently") in the commit
> titles.
Will fix in the next iteration.
> Shouldn't obstack.[ch] be in compat/ so that people on platforms where
> they are natively available do not have to compile our own copies?
There is code in obstack.c to check if we are using gnu libc or not.
If gnu libc is used, then ELIDE_CODE is defined and no code from
obstack.c is compiled.
> It is somewhat curious that you gave numbers for only negative case in
> pickaxe test and numbers for only positive case in grep test. Does this
> conversion have some interesting performance charasteristics such as
> penalizing positive-match case to speed up negative-match case or vice
> versa (the earlier "grep lookahead" work had that effect, even though the
> downside was really small)?
I did some more benchmarking. In the extreme case when we are looking
for ' ' (i.e., a single space) with pickaxe the new code is actually
slightly slower than the old one.
before:
$ time git log -S' ' > /dev/null
real 0m32.908s
user 0m32.258s
sys 0m0.652s
after:
$ time ./git-log -S' ' > /dev/null
real 0m34.072s
user 0m33.418s
sys 0m0.656s
However, with longer strings the new code wins (the new code wins when
we are searching for two spaces).
grep gets a significant performance increase for all strings I have
tried, it doesn't matter if there are no matches or a lot of matches.
Thanks for the comments.
- Fredrik
next prev parent reply other threads:[~2010-02-14 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-13 14:20 [PATCH 0/5] Speed up string search routines Fredrik Kuivinen
2010-02-13 18:52 ` Junio C Hamano
2010-02-14 16:47 ` Fredrik Kuivinen [this message]
2010-02-14 20:16 ` Junio C Hamano
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=4c8ef71002140847i19b64b21ocfa71658a49d97b5@mail.gmail.com \
--to=frekui@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).