Interface vs pure abstract class - speed.

SundayMorningRunner someone at somewhere.com
Sun May 12 11:21:13 PDT 2013


On Sunday, 12 May 2013 at 18:14:51 UTC, Maxim Fomin wrote:
> On Sunday, 12 May 2013 at 17:31:22 UTC, SundayMorningRunner 
> wrote:
>> Hello, let's say I have the choice between using an abstract 
>> class or an interface to declare a "plan", a "template" for 
>> the descendants.
>> From the dmd compiler point of view, should I use the abstract 
>> class version (so I guess that for each method call, there 
>> will be a few MOV, in order to extract the relative address 
>> from the vmt before a CALL) or the interface version (are the 
>> CALL directly performed in this case). Are interface faster ? 
>> (to get the address used by the CALL).
>>
>> Thx.
>
> I doubt that looking from buggy compiler POV is a good idea. 
> Anyway you can take code and look into assembly.
Which is exactly what you could have done before answering ;)



More information about the Digitalmars-d-learn mailing list