This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author iritkatriel
Recipients iritkatriel
Date 2022-02-20.23:06:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645398391.66.0.675925829253.issue46808@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-02-20 23:06:31iritkatrielsetrecipients: + iritkatriel
2022-02-20 23:06:31iritkatrielsetmessageid: <1645398391.66.0.675925829253.issue46808@roundup.psfhosted.org>
2022-02-20 23:06:31iritkatriellinkissue46808 messages
2022-02-20 23:06:31iritkatrielcreate