[Haskell-cafe] Does GHC compare pointers when eval'ing (==)

Johan Tibell johan.tibell at gmail.com
Wed Aug 20 09:20:37 UTC 2014


On Wed, Aug 20, 2014 at 11:05 AM, Johan Holmquist <holmisen at gmail.com>
wrote:

> > I think the reason it isn't done is that it's not always an optimization
>
> Could you explain when it's not?
>

A simple example is when the two values aren't equal, as you'll be doing
one more branch than you otherwise would. The extra branch might also hurt
the branch predictor even in the equal case, if the branch is hard to
predict.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140820/cd71f61c/attachment.html>


More information about the Haskell-Cafe mailing list