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 methane
Recipients methane, pitrou, serhiy.storchaka
Date 2018-05-22.15:49:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1527004147.85.0.682650639539.issue33597@psf.upfronthosting.co.za>
In-reply-to
Content
@Serhiy

php implemented similar idea recently.
https://react-etc.net/entry/improvements-to-garbage-collection-gc-php-7-3-boosts-performance-in-benchmark

In short, each tracked object have only "index" of GC struct, not "pointer".
GC struct is in array and it can be resized.

I tried to copy it, but there are some challenges:

* _PyObject_GC_TRACK() will resize GC array and cause MemoryError.  It's not API compatible.
* php's GC is not generational. This design may slow down moving objects between generation.
* We need one word (index) for object header and two words (refcnt, pointer to the object) for GC struct.  It means we can reduce memory footprint only for untracked dicts and tuples.

And this is my first time GC hack.  So I gave up PHP way and choose easier way.

Anyway, we have gc.freeze() now which can be used for avoid CoW after fork.
History
Date User Action Args
2018-05-22 15:49:07methanesetrecipients: + methane, pitrou, serhiy.storchaka
2018-05-22 15:49:07methanesetmessageid: <1527004147.85.0.682650639539.issue33597@psf.upfronthosting.co.za>
2018-05-22 15:49:07methanelinkissue33597 messages
2018-05-22 15:49:07methanecreate