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 BTaskaya
Recipients BTaskaya
Date 2020-03-26.23:02:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org>
In-reply-to
Content
Just like docstrings, annotations do nothing at runtime for the majority of the time. We can just strip out them and gain as much as the docstring optimization in bytecode size on a fully annotated repo.

For comparing these two optimizations, I calculated the bytecode weight (marshal dumped size of) of each optimization (with a similar implementation to the compiler but not exact) over a project which both rich in docstrings and annotations. 

Project: https://github.com/Instagram/LibCST

 $ python simple_tester.py LibCST 
Total bytes: 1820086
Total bytes after 629 docstrings (total length of 180333) removed: 1643315
Total bytes after 8859 type annotations removed: 1641594

(I've submitted the script I used to calculate these results.)
History
Date User Action Args
2020-03-26 23:03:00BTaskayasetrecipients: + BTaskaya
2020-03-26 23:03:00BTaskayasetmessageid: <1585263780.04.0.43303586086.issue40080@roundup.psfhosted.org>
2020-03-26 23:03:00BTaskayalinkissue40080 messages
2020-03-26 23:02:59BTaskayacreate