Is D slow?
Nicholas Wilson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat Jun 10 05:23:05 PDT 2017
On Saturday, 10 June 2017 at 12:16:34 UTC, Honey wrote:
> On Saturday, 10 June 2017 at 11:53:44 UTC, Johan Engelen wrote:
>>> `-release` should be synonymous with `-release
>>> -boundscheck=off`.
>>
>> Nope it's not.
>> http://www.digitalmars.com/d/archives/digitalmars/D/What_s_the_deal_with_-boundscheck_260237.html
>
> Thank you for clarifying that point. Is it expected that
> turning off bounds checking can lead to a performance decrease?
Yes, with it on you are doing an "is the index <= the length" for
every array access. Now some of them can be elided by the
complier when it can prove that the index is always in bounds but
it is generally dangerous to do so as it opens up the possibility
of buffer overflow.
More information about the Digitalmars-d-learn
mailing list