Benchmarking sigmoid function between C and D

Daniel Kozak kozzi11 at gmail.com
Mon Apr 9 06:48:23 UTC 2018


I would say he has, becaue AFAIK mir.math.common using LLVM intrinsics

On Sat, Apr 7, 2018 at 11:53 PM, Guillaume Piolat via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> wrote:

> On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote:
>
>> On Saturday, 7 April 2018 at 19:14:27 UTC, Daniel Kozak wrote:
>>
>>> or for ldc http://docs.algorithm.dlang.io/latest/mir_math_common.html
>>>
>>> On Sat, Apr 7, 2018 at 9:10 PM, Daniel Kozak <kozzi11 at gmail.com> wrote:
>>>
>>> can you try it with c math functions?
>>>>
>>>> instead of std.math, try to use core.stdc.math
>>>>
>>>> On Sat, Apr 7, 2018 at 8:53 PM, Arun Chandrasekaran via
>>>> Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:
>>>>
>>>> [...]
>>>>>
>>>>
>> Much better with mir.math.common, still a bit slower than C (even with
>> larger loops):
>>
>> 10^7 iterations using sigmoid1: 168 ms
>> 10^7 iterations using sigmoid2: 39 ms
>>
>> Also LDC optimized away the computation. So I had to modify the code a
>> bit.
>>
>>
>
> Have you tried LLVM intrinsics? say llvm_exp
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20180409/a0d358ae/attachment.html>


More information about the Digitalmars-d-learn mailing list