Following the converting 8-bit bytecode to 16-bit bytecode (wordcode),
there are other issues for improving the bytecode.
Make the bytecode more 16-bit oriented.
Add new opcode BUILD_CONST_KEY_MAP for building a dict with constant
keys. This optimize the common case and especially helpful for two
following issues (creating and calling functions).
Simplify MAKE_FUNCTION/MAKE_CLOSURE. Instead packing three numbers in
oparg the new MAKE_FUNCTION takes built tuples and dicts from the stack.
MAKE_FUNCTION and MAKE_CLOSURE are merged in the single opcode.
Rework CALL_FUNCTION* opcodes. Replace four existing opcodes with three
simpler and more efficient opcodes.
Rework the for loop implementation.
Move unwinding of stack for "pseudo exceptions" from interpreter to
I don't understand how it happened, but apparently I got a merge commit
backward and merged 3.6 into 3.5 and pushed it without realizing what
had happened. If anyone has any clue how to reverse this cleanly,
please let me know. (There are a couple people at the sprints looking
in to it, but the mercurial guys aren't here so we are short on experts).
My apologies for the mess :(
It has been proposed to enhance the typing module with a NewType function
that allows to define simple unique types with almost zero runtime overhead.
The PR containing actual implementation and PEP 484 update is here:
Review comments are very welcome.