[pypy-dev] More on optimization

Samuele Pedroni pedronis at bluewin.ch
Sat Nov 6 19:47:58 CET 2004


Armin Rigo wrote:
> Hi Samuele,
> 
> On Thu, Nov 04, 2004 at 03:51:50PM +0100, Samuele Pedroni wrote:
> 
>>>it depends on how you implement things, realloc needs to be expressed as 
>>>alloc and copy but I don't see what force you to incapsulate the array
>>>in an extra layer object.
>>>
>>
>>oops, sorry now I see, you want RPython lists to be lists, that's 
>>probably different that what we wanted originally.
> 
> 
> No, I'm thinking about the following problem: suppose that an RPython list is
> meant to represent an expensively resizeable array.

that what I was implicitly thinking with "be lists". My point anyway was 
simply that for Java the first relevant thing is to dinstiguish 
constant-size lists (the code in listobject uses such things) vs. 
variable size lists, and both then have natural reprs. In a more subtle 
approach also lists that have always just _one_ reference to them in the 
whole heap (and are not passed as parameters perhaps) can likely also be 
implemented with a direct array reference.

It is true that the generalization and understanding of this kind of 
criteria is what we need for general structure inlining.




More information about the Pypy-dev mailing list