> 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?
No. I didn't do it because I don't know it's worth enough.
> merge-constants.patch looks simple enought, but I'm not really impressed by such result. Is 2% worth it?
Maybe, our application is somewhat special.
I'll check memory usage again with only loading major OSS framework/libraries for this issue in next time.
(BTW, it's 3% if -OO is used)
But issue28813 or other optimizations may reduce tuple size and make it possible to share more tuples.
So I think we should evaluate this patch after them.
But I don't familiar with frontend (parser, AST).
I usually look bytecode and runtime. |