Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker) - Mailing list pgsql-hackers

From David Rowley
Subject Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)
Date
Msg-id 17EF6EF77BD7405E86761C688A73BAB4@amd64
Whole thread Raw
In response to Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)
List pgsql-hackers
Heikki Linnakangas wrote:
> David Rowley wrote:
> Thanks for all the reviews and suggestions.

> David, could you re-run the performance tests you ran earlier? I'm
> curious to know what impact switching to the simpler loop for 1-byte
> pattern had.

Sure: http://www.unixbeast.com/~fat/8.3_test_v1.4.xls

I tested with 8.3.3, and applied the patch updated by tom.

The thing that surprised me was that string_to_array didn't perform as well.
I expected single character searches to perform a little better. I can't
think why it would be slower now.

The strpos() test for the single char needle is taking 1.2% longer. I guess
that makes a little sense as we're now doing a new more length tests in this
case, but then we've eliminated the final single strncmp() for once it finds
that match. The strncmp would have check for nulls, check it's not exceeded
the compare length and check the chars actually match. I figured this would
have made up for that 1.2%. Seems not.

David.



-----Original Message-----
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.com]
Sent: 08 September 2008 08:50
To: David Rowley
Cc: 'Tom Lane'; 'Peter Eisentraut'; pgsql-hackers@postgresql.org
Subject: Re: [PATCHES] [HACKERS] TODO item: Implement Boyer-Moore searching
(First time hacker)


--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Korry Douglas
Date:
Subject: Re: [PATCH] Cleanup of GUC units code
Next
From: Chris Browne
Date:
Subject: Re: Fast REVERSE() function?