[Python-Dev] Store startup modules as C structures for 20%+ startup speed improvement?
carl.shapiro at gmail.com
Thu Sep 20 14:21:06 EDT 2018
On Wed, Sep 19, 2018 at 12:32 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Also, one thing that would be interesting to find out is whether constant
> Python data structures can actually be pre-allocated in the data segment
> (and I mean their object structs) . Then things like tuples of strings
> (argument lists and what not) could be loaded and the objects quickly
> initialised (although, is that even necessary?), rather than having to heap
> allocate and create them. Probably something that we should try out in
I might not be fully understanding the scope of your question but this
patch does allocate constant data structures in the data segment. We could
be more aggressive with that but we limit our scope to what is presented to
the un-marshaling code. This may be relevant to Cython, as well.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev