At 11:19 AM +0100 4/17/04, Piers Cawley wrote:
Leopold Toetsch <[EMAIL PROTECTED]> writes:

Aaron Sherman <[EMAIL PROTECTED]> wrote:
On Fri, 2004-04-16 at 18:18, Leopold Toetsch wrote:

 Sorry, I gave the wrong impression. I meant it looks suspiciously like
 Python is doing a lazy construction on those objects, not that there is
 anything wrong with the benchmark.

No, I don't think that this is happening. Parrot's slightly slower object instantiation is due to register preserving mainly. The "__init" code is run from inside the "new PObj, IClass" opcode. As its not known that a method call is happening here, we can't use register preserving operations that only save needed registers--we have to save all registers. These two memcpys are the most heavy part of the operation.

Maybe we should rethink that then and make allocation and initialization two different phases.

That's the way I'm leaning. I know it's a *bad* idea from a high-level language point of view, but from the lower levels it's less of a bad idea.


New, then, would allocate the object and you'd need to then call its constructor, with the constructor call using full-on parrot calling conventions and giving the calling code a chance to save the registers it was interested in. Of course, then we get into the issue of handling return values from multiple calls into methods as we automatically redispatch the constructor, but...
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to