A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-February/019932.html below:

[Python-Dev] Speeding up instance attribute access

[Python-Dev] Speeding up instance attribute access [Python-Dev] Speeding up instance attribute accessGuido van Rossum guido@python.org
Mon, 11 Feb 2002 10:31:33 -0500
> Guido van Rossum <guido@python.org> writes:
> 
> > - We need fallbacks for various exceptional cases:
> 
> I think assignment to __class__ also needs to be
> considered. Therefore, it may be best if the member array is a
> separate block (not allocated with the instances).

Good point.  When __class__ is assigned and the new __class__ has a
different layout of the member array then the old, all instance
variables must be moved from the member array into a temporary dict,
and then from the temporary dict redistributed over the new member
array.  If you're lucky, the temporary dict is empty after that;
otherwise, it becomes the overflow dict.

> It might also be worthwhile to incorporate __slots__ access into that
> scheme, to avoid having to find the member descriptor in the class
> dictionary.

__slots__ are really allocated in the object, not in a separate memory
block.  But I agree it would be nice if they could somehow be integrated.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4