discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objective-c: how slow ?


From: Malmberg
Subject: Re: objective-c: how slow ?
Date: Fri, 07 Sep 2001 12:21:35 +0200

[snip]
> You have manual control over the PIC.
> Why you can't simply have a macro generate the code in place ?

You don't know what values to use for the class compare/method jump
until run-time, so you'd have to make a list of all IC:s and patch them
when the program loads.

> Is the cost of the JMP to the stub worh ?

0.5-1 cycles. The unconditional jump is cheap, and lack of conditional
call instructions means that the stub can be slightly more efficient
than the IC ('call stub;compare;jz method;jmp lookup' instead of
'compare;jmp call_stub;call lookup;jmp cont;call_stub:call
method;cont:').

> > Theoretically, there's recompilation.
> 
> Sorry, what do you mean ?

Collecting stats on test runs and using the information to inline common
methods and generate efficient IC:s. Not likely to happen anytime soon.

[snip]
> Objc has a simpler lookup because it doesn't have multiple inheritance,
> delegation 

Doesn't forwarding and DO count as delegation?

> and dynamic inheritance.

Those are language limitations. The runtime could handle all of those
(at least if I'm thinking of the same things you are) at the same speed.

- Alexander Malmberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]