Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

>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.

----------

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

Reply via email to