Hacker News new | past | comments | ask | show | jobs | submit login

Optimizing away getter/setter calls and function call overhead in general is well within the reach of current compilers.



In general, function calls cannot be inlined by the Python compiler because (almost) any function name may be re-bound to a different object at run time.

A very smart compiler could probably attempt to prove that no such modification can occur at run time throughout the whole program; but this is much harder than simply deciding whether inlining a given call is worth it or not.


V8 handles them w minimal overhead in JavaScript.


And more to the point, PyPy can do Python inlining with its tracing JIT. The method, in both cases, is similar: find some type assumptions that are useful and usually true, generate code under those assumptions, and fall back on more generic code if they're ever false.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: