Re: Speed of interfaces vs inheritance
- From: "Daniel Pitts" <googlegroupie@xxxxxxxxxxxxx>
- Date: 30 Dec 2006 17:05:56 -0800
Chris wrote:
In a particularly time-critical part of my app I need to call a method
on an external class in a tight loop. The class can be different in
different contexts. I've got two choices: create an interface and have
the various different classes implement it, or create an abstract class
and have the various different classes extend it.
I seem to recall, in years past, that the interface approach was slower.
Is this still the case?
(In this particular situation, either approach works fine, though I
personally like the interface approach better).
The overhead of method calls of any sort or considered trivial in most
circumstances. I would suggest using the approach that gives you the
best OO design, and then changing it around if its not fast enough.
Determining if its not fast enough should be down by using a profiler,
not a guess and check method.
.
- References:
- Speed of interfaces vs inheritance
- From: Chris
- Speed of interfaces vs inheritance
- Prev by Date: Re: Word Count app using tokenizer (Java)
- Next by Date: Re: Yet another generics question: Needs unchecked conversion to conform to ...
- Previous by thread: Re: Speed of interfaces vs inheritance
- Next by thread: Advantages and Disadvantages of the Spring Framework
- Index(es):
Relevant Pages
|
|