pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <dgrowley@gmail.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
To: 'Heikki Linnakangas' <heikki.linnakangas@enterprisedb.com>
To: 'Peter Eisentraut' <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)
Date: Sun, 7 Sep 2008 12:04:35 +0100
Message-ID: <E737D69A2FDE4F79832CDAF8FC6C1DEC@amd64> (raw)
In-Reply-To: <6183.1220761607@sss.pgh.pa.us>

Tom Lane Wrote:
> "David Rowley" <dgrowley@gmail.com> writes:
> > I've made the discussed changes. Also updated the benchmark results.
> > http://www.unixbeast.com/~fat/8.3_test_v1.3.xls

> Applied with revisions; mostly cosmetic except for one point.  I
> realized after studying the code a bit more that B-M cannot possibly win
> for a single-character pattern (needle), since the skip distance must
> always be 1 in that case.  The fact that it seemed to keep up at that
> length has to be because the original coding included a strncmp call
> inside the innermost loop, which likely prevents the compiler from
> optimizing that loop really tightly.  But the strncmp wasn't doing
> anything anyway for the case of pattern length = 1. So what I committed
> special-cases pattern length 1 to be a naive search with a *very* tight
> inner loop.  I think it's worth troubling over this case because a
> common usage is split_to_array and suchlike with single-character
> delimiters.

I had thought about this, but failed to think about string_to_array.
Probably worth the extra code for that.

Well simple enough patch. I've learned quite a bit about the postgresql
source even just for working in varlena.c. I've got a very long way to go
though.

Thanks for all the reviews and suggestions.

David.







view thread (21+ messages)  latest in thread

Message-ID: <E737D69A2FDE4F79832CDAF8FC6C1DEC@amd64>
Permalink:  ../E737D69A2FDE4F79832CDAF8FC6C1DEC@amd64/
Also on:    postgresql.org/message-id/E737D69A2FDE4F79832CDAF8FC6C1DEC@amd64

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: dgrowley@gmail.com, tgl@sss.pgh.pa.us, heikki.linnakangas@enterprisedb.com, peter_e@gmx.net, pgsql-hackers@postgresql.org
  Subject: Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)
  In-Reply-To: <E737D69A2FDE4F79832CDAF8FC6C1DEC@amd64>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox