[Python-ideas] Extending language syntax

Chris Angelico rosuav at gmail.com
Tue Nov 12 06:27:20 CET 2013


On Tue, Nov 12, 2013 at 4:03 PM, Gregory Salvan <apieum at gmail.com> wrote:
> I suggested generating value object by freezing object states and to have
> object identities defined on their values instead of their memory
> allocation.

I can see some potential in this if there were a way to say "This will
never change, don't refcount it or GC-check it"; that might improve
performance across a fork (or across threads), but it'd take a lot of
language support. Effectively, you would be forfeiting the usual GC
memory saving "this isn't needed, get rid of it" and fixing it in
memory someplace. The question would be: Is the saving of not writing
to that memory (updating refcounts, or marking for a mark/sweep GC, or
whatever the equivalent is for each Python implementation) worth the
complexity of checking every object to see if it's a frozen one?

ChrisA


More information about the Python-ideas mailing list