Float64 comparison operator performance

That’s a good question.

My understanding is that passing an ordering type seems to be more flexible than passing a comparison operator or function.

For example, lets say you have a custom struct, and you want to include some additional information about how to perform comparisons on these structs. These comparison rules might also change as the program is running.

You can easily include all of these comparison rules as data in a Base.Ordering struct. Here’s a code snippet describing that process.

The alternative is to convert this comparison rule data into a new comparison function each time the rules change. I can speculate on the downsides of this latter approach, but I haven’t tried it out yet. I assume Base.Ordering was provided as an alternative.

Maybe another reader could offer more concrete info about the origins and benefits of Base.Ordering.