# A new tail-calling interpreter for significantly better interpreter performance

**URL:** <https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315>\
**Category:** Core Development\
**Created:** [January 6, 2025, 10:12pm UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315 "2025-01-06T22:12:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kj0](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kj0](https://discuss.python.org/u/kj0)\
**Post date:** [January 6, 2025, 10:12pm UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315/1 "2025-01-06T22:12:25Z")

</div>

Please see [A new tail-calling interpreter for significantly better interpreter performance · Issue #128563 · python/cpython · GitHub](https://github.com/python/cpython/issues/128563).

Thank you!

---

<div class="post-metadata">

**Author:** ![nas](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/nas/32/536_2.png) [@nas](https://discuss.python.org/u/nas)\
**Post date:** [January 7, 2025, 12:51am UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315/2 "2025-01-07T00:51:04Z")

</div>

Those are some nice looking performance improvements. Based on the magnitude of the improvement, I think it’s worth some complexity and pain to make this an optional build option.

I wonder if using tail-calls for `marshal` and `_pickle` could bring significant benefits as well. Speeding up marshal would help Python startup time. Seems a bit similar to protobuf.

---

<div class="post-metadata">

**Author:** ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)\
**Post date:** [February 10, 2025, 8:57pm UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315/3 "2025-02-10T20:57:13Z")

</div>

I’m late to this party. Is the main branch supposed to build successfully on MacOS using clang v19 with `--enable-experimental-jit=yes` and `--with-tail-call-interp`?

---

<div class="post-metadata">

**Author:** ![kj0](https://avatars.discourse-cdn.com/v4/letter/k/db5fbb/32.png) [@kj0](https://discuss.python.org/u/kj0)\
**Post date:** [February 11, 2025, 8:05am UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315/4 "2025-02-11T08:05:02Z")

</div>

Not at the moment, I fixed it in a follow-up PR but it needs review before merging [gh-129819: Allow tier2/JIT and tailcall by Fidget-Spinner · Pull Request #129820 · python/cpython · GitHub](https://github.com/python/cpython/pull/129820)

---

<div class="post-metadata">

**Author:** ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)\
**Post date:** [February 11, 2025, 4:09pm UTC](https://discuss.python.org/t/a-new-tail-calling-interpreter-for-significantly-better-interpreter-performance/76315/5 "2025-02-11T16:09:26Z")

</div>

Thanks. Not a review, but I can confirm that the interpreter compiles and tests run with the patch.
