We should deprecate -release
H. S. Teoh
hsteoh at qfbox.info
Sun Jul 14 14:03:04 UTC 2024
On Sun, Jul 14, 2024 at 12:52:36PM +0000, Zoadian via Digitalmars-d wrote:
> On Saturday, 13 July 2024 at 16:48:29 UTC, Walter Bright wrote:
> > On 7/13/2024 8:28 AM, Vladimir Panteleev wrote:
> > > It's equivalent to `-check=invariant=off -check=in=off
> > > -check=out=off -check=bounds=safeonly -check=assert=off
> > > -check=switch=off` (and what Nicholas pointed out).
> > >
> > > `-O` and `-inline` are orthogonal to `-release` (and to each
> > > other).
> >
> >
> > Hmm, checking the actual implementation, you're right. Someone must
> > have changed it at some point. -release is supposed to be "fastest
> > code". Need to fix that!
>
> then rename it to -benchmark.
+1. Calling it -release is misleading and breaks safety guarantees.
That's very bad.
Alternatively, just redirect -release to running ldc2 instead. In almost
every D program I've written, ldc2 produces an executable that runs
30-40% faster than the same program compiled by dmd (sometimes even
50%). No amount of suppressing bounds checks is going to give you that
kind of performance boost, so why break safety over marginal gains that
isn't winning you any benchmarks anyway? Just admit it and have
-release run ldc2. Even with bounds checks still enabled, you get an
instant 30% performance boost. *That's* what's gonna catch attention,
not some half-baked safety-breaking switch in a suboptimal optimizer
that's going to lose out to C benchmarks anyway.
T
--
"Holy war is an oxymoron." -- Lazarus Long
More information about the Digitalmars-d
mailing list