Re: CopyReadLineText optimization

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: CopyReadLineText optimization
Date: 2008-03-05 14:50:02
Message-ID: 47CEB31A.3050406@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Heikki Linnakangas wrote:
> Heikki Linnakangas wrote:
>> Attached is a patch that modifies CopyReadLineText so that it uses
>> memchr to speed up the scan. The nice thing about memchr is that we
>> can take advantage of any clever optimizations that might be in libc
>> or compiler.
>
> Here's an updated version of the patch. The principle is the same, but
> the same optimization is now used for CSV input as well, and there's
> more comments.

Another update attached: It occurred to me that the memchr approach is
only safe for server encodings, where the non-first bytes of a
multi-byte character always have the hi-bit set.

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

Attachment Content-Type Size
copy-readline-memchr-4.patch text/x-diff 7.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin M. Roy 2008-03-05 15:09:44 Re: 8.3.0 Core with concurrent vacuum fulls
Previous Message Tom Lane 2008-03-05 14:16:52 Re: 8.3.0 Core with concurrent vacuum fulls

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2008-03-05 15:03:22 Re: WIP: guc enums
Previous Message Gavin Sherry 2008-03-05 14:27:33 Re: Bulk Insert tuning