Message286230
> 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. |
|
Date |
User |
Action |
Args |
2017-01-25 07:45:20 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, vstinner, methane |
2017-01-25 07:45:19 | serhiy.storchaka | set | messageid: <1485330319.99.0.132630530539.issue29336@psf.upfronthosting.co.za> |
2017-01-25 07:45:19 | serhiy.storchaka | link | issue29336 messages |
2017-01-25 07:45:19 | serhiy.storchaka | create | |
|