3 ms·
When one Python function calls another, does that ultimately result in the CPU executing a `call` instruction, or not? Python 3.11 changed from "yes" to "no" f
by pansa2 2y ago
When one Python function calls another, does that ultimately result in the CPU executing a `call` instruction, or not?
Python 3.11 changed from "yes" to "no" for performance reasons.
Lua, OTOH, changed from "no" to "yes" in 5.4.0, again for performance. It then changed back to "no" in 5.4.2 for other reasons, despite the performance regression.
(In Lua 5.1, instead of call/`return`, `coroutine.resume/yield` is implemented using C-level call/`return`. That would preclude implementing call/`return` the same way - but since 5.2 the coroutine functions are instead implemented via call/`longjmp`.)