3 ms·
I think it is both. In the process of confirming, I think I found the answer within the Elm docs[0]: > Note: When are two values “the same” though? To optimiz
by truculent 5y ago
I think it is both.
In the process of confirming, I think I found the answer within the Elm docs[0]:
> Note: When are two values “the same” though? To optimize for performance, we use JavaScript’s === operator behind the scenes
> ...
> Using reference equality is always cheap O(1), even when the data structure has thousands or millions of entries. So this is mostly about making sure that using lazy will never slow your code down a bunch by accident. All the checks are super cheap!
It's not as elegant but you'd only ever use Html.Lazy for performance, so this trade-off seems to make perfect sense.
[0]: https://guide.elm-lang.org/optimization/lazy.html https://guide.elm-lang.org/optimization/lazy.html