On 22/07/2020 10:07 am, Antoine Pitrou wrote:
On Wed, 22 Jul 2020 12:46:40 +0900 Inada Naoki firstname.lastname@example.org wrote:
On Wed, Jul 22, 2020 at 3:43 AM Mark Shannon email@example.com wrote:
On 18/07/2020 9:20 am, Inada Naoki wrote:
It seems great improvement, but I am worrying about performance.
Adding more attributes to the code object will increase memory usage and importing time. Is there some estimation of the overhead?
Zero overhead (approximately). We are just replacing one compressed table with another at the C level. The other attributes are computed.
And I am worrying precise tracing blocks future advanced bytecode optimization. Can we omit precise tracing and line number information when optimization (`-O`) is enabled?
I don't think that is a good idea. Performing any worthwhile performance optimization requires that we can reason about the behavior of programs. Consistent behavior makes that much easier. Inconsistent "micro optimizations" make real optimizations harder.
Tracing output is included in the program behavior?
For example, if two code block is completely equal:
if a == 1: very very long code block elif a == 2: very very long code block
This code can be translated into like this (pseudo code):
if a == 1: goto block1 if a == 2: goto block1 block1: very very long code block
But if we merge two equal code blocks, we can not produce precise line numbers, can we? Is this inconsistent microoptimization that real optimization harder? This optimization must be prohibited in future Python?
All attempts to improve Python performance by compile-time bytecode optimizations have more or less failed (the latter was Victor's, AFAIR). Is there still interest in pursuing that avenue?
We are continually improving the bytecode, but there is probably only one or two percent speed up left possible from such improvements. None of those improvements would prevent accurate line numbers.
Python-Dev mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://firstname.lastname@example.org/message/BDLZC3SS... Code of Conduct: http://python.org/psf/codeofconduct/