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 methane, rhettinger, serhiy.storchaka, vstinner
Date 2017-01-25.07:45:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1485330319.99.0.132630530539.issue29336@psf.upfronthosting.co.za>
In-reply-to
Content
> merge-constants.patch looks simple enought, but I'm not really impressed by such result. Is 2% worth it?

I'm not impressed too. And merging constants can take time.

> Since code objects loaded by import are likely for stay for the whole lifetime of a process, I would be interested to experiment interning all constant objects (the tuple of objects, but also each object of these tuples, so support "nested interning") of all code objets (consts, names, varnames, freevars, cellvars) in the marshal module.

This could slow down marhalling. Some patches in issue20416 implements this, but current code is faster and much simpler and the benefit of deduplicating constants is too small.

> More generally, would it be possible to share co_consts (None,) tuples between code objects of two different modules? Or is it already the case with merge-constants.patch?

All patches in this issue shares constants only in one compilation unit (module). Otherwise the global intern dict would increase the memory usage too much.

See also the statistics in issue16475. The most memory is spent by strings, and the majority of strings already are interned.
History
Date User Action Args
2017-01-25 07:45:20serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, vstinner, methane
2017-01-25 07:45:19serhiy.storchakasetmessageid: <1485330319.99.0.132630530539.issue29336@psf.upfronthosting.co.za>
2017-01-25 07:45:19serhiy.storchakalinkissue29336 messages
2017-01-25 07:45:19serhiy.storchakacreate