Python from Wise Guy's Viewpoint

Fergus Henderson fjh at cs.mu.oz.au
Wed Oct 29 11:24:22 EST 2003


Pascal Costanza <costanza at web.de> writes:
>Fergus Henderson wrote:
>>Pascal Costanza <costanza at web.de> writes:
>>>Fergus Henderson wrote:
>>>>Pascal Costanza <costanza at web.de> writes:
>>>Furthermore, if I remember correctly, dynamically compiled systems use 
>>>type inferencing at runtime to reduce the number of type checks.
>> 
>> In cases such as the one described above, they may reduce the number of
>> times that the type of the _collection_ is checked, but they won't be
>> able to avoid checking the element type at every element access.
>
>Why? If the collection happens to contain only elements of a single type 
>(or this type at most), you only need to check write accesses if they 
>violate this condition. As long as they don't, you don't need to check 
>read accesses.

So which, if any, implementations of dynamic languages actually perform such
optimizations?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.




More information about the Python-list mailing list