Re: [GENERAL] Is float8 a reference type? - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Is float8 a reference type?
Date
Msg-id 27465.1506184824@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Is float8 a reference type?  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Responses Re: [GENERAL] Is float8 a reference type?
List pgsql-general
Paul A Jungwirth <pj@illuminatedcomputing.com> writes:
> Since I'm expecting ~10 million elements per array, it seems like
> skipping the conversion will have a real effect. I checked the
> assembly and do see a difference (on both Mac+clang and Linux+gcc).

I wonder whether you're using up-to-date Postgres headers (ones
where Float8GetDatum is a static inline function).  For me, both
of those platforms recognize it as a no-op --- in fact, clang
turns a loop like
   for (i = 0; i < n; i++) {       datums[i] = Float8GetDatum(floats[i]);   }

into something that looks suspiciously like an inlined, loop-unrolled
memcpy().
        regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Adding Cyrillic support
Next
From: Paul A Jungwirth
Date:
Subject: Re: [GENERAL] Is float8 a reference type?