4 ms·
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 th
by regularfry 3y 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.
- tialaramex 3y agoIt'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".
- Atlas22 3y agoLooks like cpython does the same thing if for small n. https://github.com/python/cpython/blob/a9c6e0618f26270e2591b3d99ffeef55eea02a33/Modules/mathmodule.c#L2017 https://github.com/python/cpython/blob/a9c6e0618f26270e2591b...