Irit Katriel <iritkatr...@gmail.com> added the comment:

The patch in PR31448 delays the creation of an implicit block to when it is 
needed (do if we begin using another block before a new instruction is added, 
the implicit block is never created). 

I counted how many empty blocks are being detected by the optimizer during 
"python -m test" and this number went down from 41798 (for main) to 35405 (for 
my PR), which shows that it is not only a theoretical possibility but actually 
happens. It would be things like:

NEXT_BLOCK()
VISIT_SEQ(c, stmt, s->v.Try.orelse);
compiler_use_next_block(c, end);

where the orelse block is empty.


In summary, the patch simplifies the code as well as making it more efficient.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46808>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to