On Wed, 14 May 2014 21:20:05 +0000
Kapps via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:

> That pull shows that the previous behaviour was to use enforce?
> Isn't this very expensive, particularly considering that enforce
> uses lazy non-scope arguments?

Yeah, much as Andrei would hate to hear it (enforce was his idea, and he quite
likes the idiom), the fact that lazy is so inefficient makes it so that it's
arguably bad practice to use it in high performance code. We really need to
find a way to make it so that lazy is optimized properly so that we _can_
safely use enforce, but for now, it's not a good idea unless the code that
you're working on can afford the performance hit.

Honestly, in general, I'd avoid most anything which uses lazy (e.g. that's why
I'd use explict try-catch blocks rather than use
std.exception.assumeWontThrow - like enforce, it's a nice idea, but it's too
expensive at this point).

- Jonathan M Davis
  • Array!T and find are slow Damian Day via Digitalmars-d-learn
    • Re: Array!T and find are... David Nadlinger via Digitalmars-d-learn
      • Re: Array!T and find... Damian Day via Digitalmars-d-learn
        • Re: Array!T and ... David Nadlinger via Digitalmars-d-learn
          • Re: Array!T ... Kapps via Digitalmars-d-learn
            • Re: Arr... monarch_dodra via Digitalmars-d-learn
            • Re: Arr... Jonathan M Davis via Digitalmars-d-learn
            • Re: Arr... Meta via Digitalmars-d-learn
              • Re:... Kapps via Digitalmars-d-learn
                • ... Jonathan M Davis via Digitalmars-d-learn
                • ... monarch_dodra via Digitalmars-d-learn
                • ... Jonathan M Davis via Digitalmars-d-learn
                • ... monarch_dodra via Digitalmars-d-learn
                • ... Ary Borenszweig via Digitalmars-d-learn
                • ... Jonathan M Davis via Digitalmars-d-learn
                • ... Steven Schveighoffer via Digitalmars-d-learn
                • ... Jonathan M Davis via Digitalmars-d-learn

Reply via email to