Re: CopyReadLineText optimization - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: CopyReadLineText optimization
Date
Msg-id 47D57219.6080402@dunslane.net
Whole thread Raw
In response to Re: CopyReadLineText optimization  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: CopyReadLineText optimization  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-patches

Heikki Linnakangas wrote:
> Andrew Dunstan wrote:
>> Another question that occurred to me - did you try using strpbrk() to
>> look for the next interesting character rather than your homegrown
>> searcher gadget? If so, how did that perform?
>
> It looks like strpbrk() performs poorly:


Yes, not surprising. I just looked at the implementation in glibc, which
I assume you are using, and it seemed rather basic. The one in NetBSD's
libc looks much more efficient.

See


http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/libc/string/strpbrk.c?rev=1.1.2.1&content-type=text/plain&cvsroot=glibc
and

http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/lib/libc/string/strpbrk.c?rev=1.16;content-type=text%2Fx-cvsweb-markup

Not that what you've done isn't good, if a little obscure (as is the
NetBSD implementation)

cheers

andrew




pgsql-patches by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: CopyReadLineText optimization
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Fix for large file support (nonsegment mode support)