Hacker News new | ask | show | jobs
by regularfry 1138 days ago
It's a targeted micro-optimisation that doesn't say anything about codon's more general-case numeric performance. Unless the other implementations are using the same algorithm it's not comparing like with like.
2 comments

It's not that targeted. Factorial is a reasonable thing to do, optimising for the values that fit in a 64-bit integer is a reasonable thing to do.

If I read this in some code, I wouldn't think "Huh, that's a specialised feature, I bet it's attacking a specific benchmark" I would think, "Oh, that makes sense".

Looks like cpython does the same thing if for small n.

https://github.com/python/cpython/blob/a9c6e0618f26270e2591b...