Re: Faster StrNCpy - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Faster StrNCpy
Date
Msg-id 3776.1159565670@sss.pgh.pa.us
Whole thread Raw
In response to Re: Faster StrNCpy  (mark@mark.mielke.cc)
Responses Re: Faster StrNCpy  (mark@mark.mielke.cc)
List pgsql-hackers
mark@mark.mielke.cc writes:
> If anybody is curious, here are my numbers for an AMD X2 3800+:

You did not show your C code, so no one else can reproduce the test on
other hardware.  However, it looks like your compiler has unrolled the
memcpy into straight-line 8-byte moves, which makes it pretty hard for
anything operating byte-wise to compete, and is a bit dubious for the
general case anyway (since it requires assuming that the size and
alignment are known at compile time).

This does make me wonder about whether we shouldn't try the
strlen+memcpy implementation I proposed earlier ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: mark@mark.mielke.cc
Date:
Subject: Re: Faster StrNCpy
Next
From: Tom Lane
Date:
Subject: Re: Per-database search_path