On Wed, 22 Jul 2020 19:42:30 +0900 Inada Naoki firstname.lastname@example.org wrote:
On Wed, Jul 22, 2020 at 6:12 PM Antoine Pitrou email@example.com wrote:
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?
I don't think all attempts are failed. Note that current CPython includes some optimization already.
The set of compile-time optimizations has almost not changed since at least 15 years ago.
And I think there are some potential optimization if we can limit some debugging/introspecting features, like some C variables are "optimzed away" in gdb when we use -O option.
You can think it, but where's the proof? Or at least the design document for these optimizations? How do you explain that Victor's attempt at static optimization failed?