We should deprecate -release

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Jul 14 15:45:45 UTC 2024


On 15/07/2024 3:36 AM, Guillaume Piolat 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!
> 
> I honestly don't really care if -release exists or does the right thing, 
> as long as
> 
> dub -b release-nobounds gives me the (reasonably) fastest possible thing

For reference:

https://dub.pm/dub-reference/buildtypes/

```js
         "release": {
             "buildOptions": ["releaseMode", "optimize", "inline"]
         },
         "release-debug": {
             "buildOptions": ["releaseMode", "optimize", "inline", 
"debugInfo"]
         },
         "release-nobounds": {
             "buildOptions": ["releaseMode", "optimize", "inline", 
"noBoundsCheck"]
         }
```

And:

```
It's recommended to avoid this build type and instead change the 
algorithms that are affected by this the most to do a single bounds 
check before many array accesses and operate on the ptr field following 
that. This results in the same performance improvements while not 
harming safety.
```



More information about the Digitalmars-d mailing list