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: Paul Eggert
Subject: bug#17229: [PATCH 2/2] grep: speed-up by using memchr() in Boyer-Moore searching
Date: Wed, 23 Apr 2014 00:08:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Norihiro Tanaka wrote:
Now I wrote the additional patch.

Sorry, I don't understand that patch. I applied your earlier patch (attachment 1) and then merged that patch (attachment 2), but the resulting 'grep' failed 'make check'; I got a "FAIL: fedora" and the test after "file" never finished. This was on Fedora 20 x86-64 with my own installation of GCC 4.9.0.

Instead of trying to understand that patch, I wrote a different patch (attachment 3) that simplifies the code and removes the part that is x86-specific. This improves the performance quite a bit for the test case given in the ChangeLog entry. I also tested performance on Sparc Solaris 10, and memchr was a big win there. Perhaps there are platforms where memchr is a big loss, but we can cross that bridge if we come to it.

Perhaps I merged that patch incorrectly, so I'll leave this bug open for now. To be honest I hope that patch doesn't improve performance significantly if we get it to work correctly, as it looks tricky.

Attachment: 0001-grep-speed-up-by-using-memchr-in-Boyer-Moore-searchi.patch
Description: Text document

Attachment: 0001-grep-speed-up-by-replacing-incr-to-add-in-x86-and-x8.patch
Description: Text document

Attachment: 0002-kwset-simplify-and-speed-up-Boyer-Moore-unibyte-i-in.patch
Description: Text document


reply via email to

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