Requesting Help with Optimizing Code

Kyle Ingraham kyle at kyleingraham.com
Thu Apr 8 17:08:40 UTC 2021


On Thursday, 8 April 2021 at 14:20:27 UTC, Guillaume Piolat wrote:
> On Thursday, 8 April 2021 at 14:17:09 UTC, Guillaume Piolat 
> wrote:
>> On Thursday, 8 April 2021 at 01:24:23 UTC, Kyle Ingraham wrote:
>>>
>>> Is there anything else I can do to improve performance?
>>>
>>
>> - profiling?
>> - you can use _mm_pow_ps in intel-intrinsics package to have 
>> 4x pow at once for the price of one.
>
> Also if you don't need the precision: always use powf instead 
> of pow for double, use expf instead of exp for double, etc. 
> Else you pay extra.
> In particular, llvm_pow with a float argument is a lot faster.

Great tips here. I wasn't aware of powf and its cousins. I also 
like that intel-intrisics works across compilers and CPU 
architectures. I'll see what I can do with them.


More information about the Digitalmars-d mailing list