[pypy-dev] Re: Help me understand why PyPy is so slow in my benchmark

2024-09-20 Thread CF Bolz-Tereick via pypy-dev
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

[pypy-dev] Re: Help me understand why PyPy is so slow in my benchmark

2024-09-20 Thread CF Bolz-Tereick via pypy-dev
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