Need for speed

matheus matheus at gmail.com
Thu Apr 1 19:25:53 UTC 2021


On Thursday, 1 April 2021 at 19:00:08 UTC, Berni44 wrote:
>
> Try using ldc2 instead of dmd:
>
> ```
> ldc2 -O3 -release -boundscheck=off -flto=full 
> -defaultlib=phobos2-ldc-lto,druntime-ldc-lto speed.d
> ```
>
> should produce much better results.

Since this is a "Learn" part of the Foruam, be careful with 
"-boundscheck=off".

I mean for this little snippet is OK, but for a other projects 
this my be wrong, and as it says here: 
https://dlang.org/dmd-windows.html#switch-boundscheck

"This option should be used with caution and as a last resort to 
improve performance. Confirm turning off @safe bounds checks is 
worthwhile by benchmarking."

Matheus.


More information about the Digitalmars-d-learn mailing list