[Python-ideas] POPT (Python Ob ject Provider Threads)

Martin Bammer mrbm74 at gmail.com
Tue Jun 19 10:47:46 EDT 2018


Hello,

because Python is a very dynamic language the memory management is heavily
used. A lot of time is used for creating (reserve memory and fill object
structure with data) and destroying objects.

Because of this and because of the discussions about the GIL I was
wondering if there isn't a solution to get Python code really executed in
parallel without the need to create several processes and without a huge
overhead.

And here comes the idea for POPT. With this idea the Python interpreter has
running several threads in background (1 thread for each object type) which
manage a set of objects as an object cache. Each object in the cache is
already preconfigured by the object provider thread. So only the part of
the object structure which is individual has to be initialized. This saves
a lot of processing time for the main thread and the memory management has
much less to do, because temporarily unused objects can be reused
immediately.
Another advantage is that every Python code uses several CPU cores in
parallel, even if it is a single threaded application, without the need to
change the Python code.

If this idea is well implemented I expect a big performance improvement for
all Python applications.

Best regards,

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180619/eccf45cb/attachment.html>


More information about the Python-ideas mailing list