From: Linus Torvalds <torvalds@linux-foundation.org>
To: Benjamin Kramer <benny.kra@googlemail.com>
Cc: Fredrik Kuivinen <frekui@gmail.com>,
Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Johannes Sixt <j.sixt@viscovery.net>
Subject: Re: [PATCH v4] Threaded grep
Date: Tue, 26 Jan 2010 08:44:12 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.1001260836520.3574@localhost.localdomain> (raw)
In-Reply-To: <4B5F1894.4070509@googlemail.com>
On Tue, 26 Jan 2010, Benjamin Kramer wrote:
>
> BSD and glibc have an "REG_STARTEND" flag to do that. I made a small
> PoC patch to use it if it's available but it didn't give any significant
> speedup on my system.
Goodie. It's noticeable for me. This is what I reported earlier:
> > $ /usr/bin/time git grep void
>
> Before:
>
> real 0m1.144s
> user 0m0.988s
> sys 0m0.148s
>
> After:
> real 0m0.290s
> user 0m1.732s
> sys 0m0.232s
and with your patch I get
real 0m0.239s
user 0m1.392s
sys 0m0.276s
and the profile shows no strlen in it:
57.12% git libc-2.11.1.so [.] re_search_internal
5.59% git [kernel] [k] copy_user_generic_string
4.09% git [kernel] [k] _raw_spin_lock
2.57% git [kernel] [k] intel_pmu_enable_all
2.46% git [kernel] [k] __d_lookup
1.94% git libc-2.11.1.so [.] re_string_reconstruct
1.87% git [kernel] [k] kmem_cache_alloc
1.68% git libc-2.11.1.so [.] _int_free
1.53% git [kernel] [k] find_get_page
1.43% git [kernel] [k] update_curr
1.27% git libc-2.11.1.so [.] __GI___libc_malloc
1.17% git [kernel] [k] _atomic_dec_and_lock
1.00% git libc-2.11.1.so [.] __GI_memcpy
Side note: the tailing end of the profiles aren't very stable, probably
because the grep executes so quickly and in so many threads, so the
functions in the one-percent range will move up and down the list
depending on just exactly where we happened to get profile hits.
Similarly, the raw_spin_lock numbers vary.
But the big picture is stable, and that 57% number (and the nonlock
copy_user_generic_string) is consistent. And your patch definitely helped
both actual performance and is visible in the profile: re_search_internal
went from ~52% to ~57%.
So ack on that patch. Looks like a good thing to do, and with the #ifdef,
it looks like it should just automatically DTRT based on regexec
implementation.
Linus
next prev parent reply other threads:[~2010-01-26 16:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-25 22:51 [PATCH v4] Threaded grep Fredrik Kuivinen
2010-01-25 23:59 ` Linus Torvalds
2010-01-26 12:10 ` Fredrik Kuivinen
2010-01-26 15:28 ` Linus Torvalds
2010-01-26 16:30 ` Benjamin Kramer
2010-01-26 16:44 ` Linus Torvalds [this message]
2010-01-26 16:56 ` Linus Torvalds
2010-01-26 17:19 ` Mike Hommey
2010-01-26 17:48 ` [PATCH] grep: use REG_STARTEND (if available) to speed up regexec Benjamin Kramer
2010-01-26 1:20 ` [PATCH v4] Threaded grep Junio C Hamano
2010-01-26 11:43 ` Fredrik Kuivinen
2010-01-26 17:21 ` 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=alpine.LFD.2.00.1001260836520.3574@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=benny.kra@googlemail.com \
--cc=frekui@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.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).