Hi,
Now that we are OK with static inline functions, we can save some cycles
from floating-point functions, by turning Float4GetDatum,
Float8GetDatum, and DatumGetFloat8 into static inlines. They are only a
few instructions, but couldn't be implemented as macros before, because
they need a local union-variable for the conversion.
That can add up to significant speedups with float-heavy queries. For
example:
create table floats as select g::float8 as a, g::float8 as b, g::float8
as c from generate_series(1, 1000000) g;
select sum(a+b+c+1) from floats;
The sum query is about 4% faster on my laptop with this patch.
- Heikki