Is it possible to use D's O optimisation when using dub run command line?
The package manager is absolutely fantastic, and just wondering if it is possible to pass along the following switches.
-O -release -inline -boundscheck=off
Is it possible to use D's O optimisation when using dub run command line?
The package manager is absolutely fantastic, and just wondering if it is possible to pass along the following switches.
-O -release -inline -boundscheck=off
You should really never use those switches. dmd's optimizer is near useless, its inliner barely works,
-releaseintroduces undefined behavior, and-boundscheck=offintroduces security holes to your application. There's a reason none of them are default!If you want effective optimization and inlining, use gdc or ldc instead, as they are D's optimizing compilers.
That said,
dubwill pass those switches if you usedub build -b release-nobounds. See the options in the docs here:https://dub.pm/commandline