Range (statistics)

Yes, extrema() is still 3x slower

branch prediction?

One answer is #45581. Which seems to be 3-4x faster than the functions above.

3 Likes

Thank you for all the valuable answers. In the absence of a dedicated range function in the standard library, I marked the one from @stillyslalom as the solution, as it is the most compact one that uses extrema(), which according to @mcabbott will be greatly accelerated soon.

1 Like