I've heard that there's a performance penalty with using both floats and doubles. Obviously mixing the two in a calculation would require a conversion. However, is there a penalty if you do some float calculations, then do some double calculations, without the floats ever touching the doubles?
It's hard to imagine you would be asking this question if you actually needed that kind of optimization, so the short answer is, segregating types is a little better. But the performance penalty for not doing so is usually not significant unless it's in an inner loop. Don't worry about it until you need to.
If you're really concerned about this type of optimization, you should be manually tuning the calculation in assembly, making especially sure to use the high performance floating point math instructions. Segregation of floats and doubles for calculation should be a little faster, but there's a lot of factors that go into it, and really the answer is to learn about the machine and cpu architecture and use the knowledge to profile, experiment and optimize.
Name:
Anonymous2014-02-07 8:42
race mixing considered harmful
Name:
Anonymous2014-02-07 10:53
>>5
Only by ignorant butthurt "proud" faggots. Racial mixing can make us stronger in the long run.
Having said that, i would never allow my daughter, if i even have one, to marry a dirty nigger, but won't care if he is asian or arab.
>>1 However, is there a penalty if you do some float calculations, then do some double calculations, without the floats ever touching the doubles?
It's possible that breaking things up could limit opportunities for vectorization, but it's hard to say for sure without seeing the actual code and knowing what your target is.