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 serhiy.storchaka
Recipients gvanrossum, iritkatriel, rhettinger, serhiy.storchaka
Date 2021-09-10.07:45:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1631259936.62.0.967959135692.issue45152@roundup.psfhosted.org>
In-reply-to
Content
From my experience, the largest cost in importing module (after I/O) is for creating classes, especially classes with complex creation code: enums and dataclasses (and namedtuples in past, but they were significanly optimized since).

For I/O, would using zipimport or any other container help? It should reduce the number of stats and opens and allow to use compression.

As for increasing performance of demarshallization, it is already very fast (all is read from memory buffers, all repeated objects are cached). Switching to "wordcode" (32- or 64- bit instructions) and aligning all objects at the boundary of 4-8 bytes can marginally increase decoding speed, but it needs testing. Also more optimal using of references (like pickletools.optimize()) can reduce unmarshalling time at the cost of increasing marshalling time and memory consumption. It can also help with deterministic marshalling.
History
Date User Action Args
2021-09-10 07:45:36serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, rhettinger, iritkatriel
2021-09-10 07:45:36serhiy.storchakasetmessageid: <1631259936.62.0.967959135692.issue45152@roundup.psfhosted.org>
2021-09-10 07:45:36serhiy.storchakalinkissue45152 messages
2021-09-10 07:45:36serhiy.storchakacreate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.