[Python-ideas] Add specialized bytecode with guards to functions

Nick Coghlan ncoghlan at gmail.com
Wed Oct 21 18:11:04 CEST 2015


On 21 October 2015 at 17:48, Chris Angelico <rosuav at gmail.com> wrote:
> On Thu, Oct 22, 2015 at 2:43 AM, Victor Stinner
> <victor.stinner at gmail.com> wrote:
>> Roadmap
>> =======
>>
>> * Finish the proof-of-concept: implement new guards, optimize method
>>   calls. For example, guards on module imports are required. Checking
>>   if a module is the expected mode can be tricky.
>> * Write an optimizer based on manual hints
>> * Write a profiler to generate hints
>
> * Compare against PyPy.
>
> For optimized Python execution, my brain immediately jumps to PyPy.
> How does FAT Python compare in terms of functionality, performance,
> CPython compatibility, etc? What can it brag as its advantage?

* Full CPython C API compatibility
* Reliance on ahead of time compilation means it works for command
line scripts, not just long running server processes that allow the
PyPy tracing JIT to work its magic

As an ahead-of-time optimisation, it's also possible something like
this could speed up applications running on PyPy during the JIT
warm-up phase.

An existing example of this kind of guard-based optimisation exists in
the ABC machinery - we globally version the ABC registration graph in
order to automatically invalidate caches when a new explicit
registration is added.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list