|
-
Dec 11th, 2000, 10:11 AM
#1
Thread Starter
transcendental analytic
Whats the overhead using virtual methods? How much memory and performance do i loose?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 11th, 2000, 11:35 AM
#2
Addicted Member
Hmm
From what I've seen it doesn't make a huge difference. But then again I may be wrong
-
Dec 12th, 2000, 03:23 AM
#3
Thread Starter
transcendental analytic
eeeh, well i need to know a bit more than that
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 12th, 2000, 10:38 AM
#4
Frenzied Member
I'm pretty sure you don't loose anything, they're just for the compiler, when it's compiled it's like they weren't there.
If it wasn't for this sentence I wouldn't have a signature at all.
-
Dec 12th, 2000, 10:56 AM
#5
Addicted Member
So?
So I was right?
-
Dec 13th, 2000, 07:34 AM
#6
Thread Starter
transcendental analytic
I'm reading a tutorial that refers to this overhead, i'm afraid it's important to me, since I really want to have virtual methods on some very extensively used classes.
Q. Why not make all functions virtual?
A. Virtual functions are supported by a virtual function table, which incurs runtime overhead, both in the size of the program and in the performance of the program. If you have very small classes that you don't expect to subclass, you may not want to make any of the functions virtual.
from the Q&A section in http://www.itknowledge.com/reference...8/htm/ch13.htm
Also another quote about multiple inheritance:
New Term: An interface is much like an Abstract Data Type in that it defines a set of functions that can only be implemented in a derived class. However, with interfaces, you don't directly derive from the interface, you derive from another class and implement the interface, much like multiple inheritance. Thus, this marriage of an abstract data type and multiple inheritance gives you something akin to a capability class without the complexity or overhead of multiple inheritance. In addition, because interfaces cannot have implementations nor data members, the need for virtual inheritance is eliminated.
Is there something i should be aware of with reference to overheads, since i'm planning to use multiple inheritance?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 13th, 2000, 11:35 AM
#7
Addicted Member
Hmm
Well I guess I would also like to know, I'm an inheiritance newbie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|