Re: [PATCH] backend: compare word-at-a-time in bcTruelen - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date
Msg-id 20090626121211.GI20436@tamriel.snowman.net
Whole thread Raw
In response to Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Jeremy Kerr <jk@ozlabs.org>)
Responses Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Jeremy Kerr <jk@ozlabs.org>)
List pgsql-hackers
* Jeremy Kerr (jk@ozlabs.org) wrote:
> > Is it just the size that matters, or is it when there are few spaces
> > at the end?
>
> It's the number of spaces at the end. If we knew this number, then we
> wouldn't have to do any comparisons at all :)

I meant in terms of affecting the performance of this function..  We
know the total length of the string, including spaces, coming into the
function.  If the updated function is always faster when the overall
string is at least, say, 16 characters long, then Dimitri's suggestion
to just check the overall length coming in and decide which approach to
use might make sense.  If the new function is always slower, regardless
of overall string length, when there's only 1 extra space at the end,
then chances are it's not worth it.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Jeremy Kerr
Date:
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Next
From: Jeremy Kerr
Date:
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen