bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Norihiro Tanaka
Subject: bug#17229: [PATCH 2/2] grep: speed-up by using memchr() in Boyer-Moore searching
Date: Mon, 28 Apr 2014 21:45:55 +0900

Paul Eggert wrote:
> 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.

You are right.  My compiler was too old.  It was GCC 4.1.2 on CentOS 5.10.
I retried it with GCC 4.4.7, and got the good performance.

  # Although I tried to build GCC 4.9.0, it hasn't carried out well yet.

By the way, I examined the reason why it was slow on GCC 4.1.2, and I
found that tr() isn't inlining without `-finline-loops' option, because
`-finline-small-functions' option can be used from GCC 4.3.  Although I
submit the patch, it mayn't be so important.

Thanks,
Norihiro

Attachment: patch.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]