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

Preetpal preetpal.sohal at gmail.com
Sat Mar 6 06:29:11 UTC 2021


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.


More information about the digitalmars-d-ldc mailing list