Hello Jeremy,
ouch. it turns out the problem is neither your code, nor PyPy, but
timeit. The timeit module is just not a safe benchmarking tool unless
you use it in *exactly* the right way. The way that timeit runs code is
using an exec'ed string, eg f"recurse({i})" in your case. This
bytecode-co
Hi Armin,
sort of, yes, but even the linear sequence of ifs in the iterative
version is bad. The iterative version compiles 70 traces, recursive one
190. Both kind of bad, but the performance is still ok (see other mail).
Cheers,
CF
On 2024-09-18 23:30, Armin Rigo wrote:
Hi,
On Wed, 18 Sept