Why is D significantly slower than C# in this instance?

max haughton maxhaton at gmail.com
Mon Apr 10 22:06:00 UTC 2023


On Monday, 10 April 2023 at 22:00:40 UTC, H. S. Teoh wrote:
> On Mon, Apr 10, 2023 at 09:46:25PM +0000, Artjom via 
> Digitalmars-d wrote: [...]
>> Sorry, accidentaly pasted solveDynamic() insted of 
>> solveBruteForce(),
>> it's solveBruteForce() in the code though.
>> Im using DMD and compile like "dmd .\source\app.d 
>> .\classes\solver.d"
>
> 1) You're compiling without optimization (-O), so performance 
> is not
> guaranteed to be good.
>
> 2) For anything where performance is important, don't use DMD. 
> Instead, use `gdc -O3` or `ldc2 -O2`.
>
>
> T
Unless the result is actually used the optimizer may also strip 
out the code entirely.



More information about the Digitalmars-d mailing list