
On Fri, 18 Feb 2022 14:56:10 -0700 Eric Snow <ericsnowcurrently@gmail.com> wrote:
On Wed, Feb 16, 2022 at 11:06 AM Larry Hastings <larry@hastings.org> wrote:
I experimented with this at the EuroPython sprints in Berlin years ago. I was sitting next to MvL, who had an interesting observation about it.
Classic MvL! :)
He suggested(*) all the constants unmarshalled as part of loading a module should be "immortal", and if we could rejigger how we allocated them to store them in their own memory pages, that would dovetail nicely with COW semantics, cutting down on the memory use of preforked server processes.
Cool idea. I may mention it in the PEP as a possibility. Thanks!
That is not so cool if for some reason an application routinely loads and unloads modules. Regards Antoine.