F
Fuzzy
The thread on 'why NOT to use interface?' has provoked a question -
but I'll start a new thread....
Is there any performance difference that anyone is aware of between
using interfaces for polymorphism instead of inheritance? I'm aware
of the OOP design plusses and minuses of each approach, but haven't
read much about implementation differences that may affect
performance.
I'm assuming (dangerous I know) that both approaches are implemented
through v-tables and have the same calling overhead. Therefore,
neither approach enables the JIT to inline short methods.
In the time-critical section of the app that I am designing, I don't
have the requirement of multiple interfaces being implemented by a
class, so there is no clear design decision between an interface or an
abstract base class. Also, there MAY BE SOME common code that could
be shared from the base class, but, at this point, probably not enough
to even really care about.
Any insights?
but I'll start a new thread....
Is there any performance difference that anyone is aware of between
using interfaces for polymorphism instead of inheritance? I'm aware
of the OOP design plusses and minuses of each approach, but haven't
read much about implementation differences that may affect
performance.
I'm assuming (dangerous I know) that both approaches are implemented
through v-tables and have the same calling overhead. Therefore,
neither approach enables the JIT to inline short methods.
In the time-critical section of the app that I am designing, I don't
have the requirement of multiple interfaces being implemented by a
class, so there is no clear design decision between an interface or an
abstract base class. Also, there MAY BE SOME common code that could
be shared from the base class, but, at this point, probably not enough
to even really care about.
Any insights?