On Mon, 21 Feb 2022 at 16:47, Larry Hastings <[email protected]> wrote: > > > While I don't think it's fine to play devil's advocate, given the choice > between "this will help a common production use-case" (pre-fork servers) and > "this could hurt a hypothetical production use case" (long-running > applications that reload modules enough times this could waste a significant > amount of memory), I think the former is more important. >
Can the cost be mitigated by reusing immortal objects? So, for instance, a module-level constant of 60*60*24*365 might be made immortal, meaning it doesn't get disposed of with the module, but if the module gets reloaded, no *additional* object would be created. I'm assuming here that any/all objects unmarshalled with the module can indeed be shared in this way. If that isn't always true, then that would reduce the savings here. ChrisA _______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/7XDU2THWGEX2YUD32VYY5FJXL4GFQ675/ Code of Conduct: http://python.org/psf/codeofconduct/
