Optimize Erlang comparisons or expose erlang:compare/2

This has been discussed before, here. It died out, though.

I disagree to the “better” part :sweat_smile: That is, I don’t have anything against optimization, but behind-the-curtains magic like this is by and large something nobody knows about. Slight modifications of the code can lead to it not happening, and nobody knows why.

Therefore, I would opt for having both. I also think that @nzok put it well in the linked thread by saying that compare is intention-revealing, while a chain of < == > clauses is less so.

4 Likes