GNU bug report logs - #17229
[PATCH 2/2] grep: speed-up by using memchr() in Boyer-Moore searching

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Wed, 9 Apr 2014 13:56:02 UTC

Severity: normal

Tags: moreinfo, patch

Done: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 17229 <at> debbugs.gnu.org
Subject: bug#17229: [PATCH 2/2] grep: speed-up by using memchr() in Boyer-Moore searching
Date: Sun, 27 Apr 2014 13:32:57 -0700
[Message part 1 (text/plain, inline)]
Norihiro Tanaka wrote:
> Could you try above cases?

Thanks, you're observing a 2.7x performance speedup with macros on your 
platform and your benchmark.  With the same patch, I observed only a 
1.18x speedup on the same benchmark.  As usual, I'm testing with AMD 
Phenom II X4 910e + GCC 4.9.0 + Fedora 20 + default (-O2) optimization. 
 I'm curious about why you're observing a much bigger performance 
difference with macros.  What platform are you using?

Anyway, an 18% speedup is still a speedup, so I looked into it.  GCC 
4.9.0 misses a non-obvious opportunity for function inlining.  I 
installed a tweak (attached) that should make the inlining opportunity 
obvious to compilers nowadays.  On my platform this gave a 28% speedup, 
i.e., a bit better than the macro-using patch would have.
[0001-kwset-improve-performance-by-inlining-more.patch (text/plain, attachment)]

This bug report was last modified 11 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.