Re: [PATCH] backend: compare word-at-a-time in bcTruelen

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Jeremy Kerr <jk(at)ozlabs(dot)org>
Cc: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
Subject: Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Date: 2009-06-26 12:12:12
Message-ID: 20090626121211.GI20436@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Jeremy Kerr (jk(at)ozlabs(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeremy Kerr 2009-06-26 12:47:00 Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Previous Message Jeremy Kerr 2009-06-26 12:07:41 Re: [PATCH] backend: compare word-at-a-time in bcTruelen