What LDC flags should be used to get the fastest executable on Windows?

Imperatorn johan_forsberg_86 at hotmail.com
Sat Mar 6 09:07:05 UTC 2021


On Saturday, 6 March 2021 at 06:29:11 UTC, Preetpal wrote:
> I was wondering how to get the fastest binary using the LDC 
> compiler.
>
> I am currently using the following command to compile my 
> program:
> ldc2 -O3 -release -mcpu=native -flto=full 
> -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -m64 -betterC 
> -static main.d
>
> Is the -defaultlib command might be redundant if the betterC 
> flag is being used?
>
> This is probably pretty silly but the program I am trying to 
> optimize is this one 
> (https://gist.github.com/preetpalS/d2482d6ec91eb8147e6cff43ab197ed5). The program runs on each keystroke so I would like to optimize it.

There's not much going on in the code there. Where are you 
experiencing problems? Have you profiled it?


More information about the digitalmars-d-ldc mailing list