Humble benchmark (fisher's exact test)

max haughton maxhaton at gmail.com
Sun Aug 15 12:18:38 UTC 2021


On Sunday, 15 August 2021 at 09:20:56 UTC, Ki Rill wrote:
> On Saturday, 14 August 2021 at 10:26:52 UTC, John Colvin wrote:
>> On Saturday, 14 August 2021 at 02:19:02 UTC, Ki Rill wrote:
>>> It's a simple benchmark examining:
>>> * execution time (sec)
>>> * memory consumption (kb)
>>> * binary size (kb)
>>> * conciseness of a programming language (lines of code)
>>>
>>> [Link](https://github.com/rillki/humble-benchmarks/tree/main/fishers-exact-test)
>>
>> Lots of things to improve there.
>>
>> https://github.com/rillki/humble-benchmarks/pull/4
>>
>> A nice quick morning exercise :)
>
> I have added the proposed changes. The performance of D 
> increased to almost that of C with ~1-2 seconds difference if 
> using LDC!
>
> The betterC version is still slightly faster though.
>
> To sum up:
> ```
> Clang C           9.1 s
> Clang C++         9.4 s
> LDC Das betterC   10.3 s
> LDC D libC math   12.2 s
> Rust              13 s
> ```
>
> Thank you John for you invaluable help! I didn't know that 
> Phobos math is twice as slow as libC math.

I could be wrong but I think our routines internally use the max 
precision when the can, so they are slower but they are also more 
precise in the internals (where allowed by the platform). You 
could probably test this by running these benchmarks on ARM or 
similar.


More information about the Digitalmars-d mailing list