[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

Mark Shannon report at bugs.python.org
Fri Oct 23 08:20:41 EDT 2020


Mark Shannon <mark at hotpy.org> added the comment:

Is this worthwhile?

Statically, BUILD_CONST_KEY_MAP represents 0.14% of all bytecode instructions in the standard library, but only 0.03% of the bytecode instructions in functions.
Which suggests that dynamically only 1 in 3000 instructions executed is BUILD_CONST_KEY_MAP. The implication is that making BUILD_CONST_KEY_MAP more complex is just as likely to slow things down as speed them up.

Do you have any evidence that this will make a measurable difference?

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42126>
_______________________________________


More information about the Python-bugs-list mailing list