top | item 45533043

(no title)

haberman | 4 months ago

Do any of these tests measure the new experimental tail call interpreter (https://docs.python.org/3.14/using/configure.html#cmdoption-...)?

I couldn't find any note of it, so I would assume not.

It would be interesting to see how the tail call interpreter compares to the other variants.

discuss

order

miguelgrinberg|4 months ago

The build of Python that I used has tail calls enabled (option --with-tail-call-interp). So that was in place for the results I published. I'm not sure if this optimization applies to recursive tail calls, but if it does, my Fibonacci test should have taken advantage of the optimization.

ufo|4 months ago

The tail calls in question are C tail calls inside the inner interpreter loop. They have nothing to do with Python function calls.

emil-lp|4 months ago

It wouldn’t have, since

    fib(n-1) + fib(n-2)
isn’t a tail call—there’s work left after the recursive calls, so the tail call interpreter can’t optimize it.