Sujet : Re: is double slower?
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 04. Nov 2024, 19:23:21
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <7517c8a81fd26d278888d4c3374b2b8281292510@i2pn2.org>
References : 1 2 3
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
fir wrote:
Chris M. Thomasson wrote:
On 11/3/2024 11:53 PM, fir wrote:
float takes less space and when you keep arrays of floats for sure float
is better (less spase and uses less memory bandwidth so i guess floats
can be as twice faster in some aspects)
>
but when you do calculations on local variables not floats do the
double is slower?
>
Ask the GPU.
>
why? as tu cpu im not sure as on older cpus the calculations was anyway
made on double hardware (?, im not so sure) even if you passed float
to function im not sure if on assembly level yu not passed double
>
then after sse afair you got scalar code for floats and doubles
bbut simply i realized i dont know if double calculation on local
variables (not arrays) are in fakt anyway notable slower
>
>
im writing some cpu intensive experiment (something liek alpha blending images on cpu mostly) and interestingly i just turned float into double
in that routine and it speeded up (as far as i can see, as i dont have tme for much tests , changing to double turnet 35 ,s per frame into 34 ms per frame