No subject


Thu May 24 20:53:25 EDT 2007


A C++ method call off a pointer is two loads and an indirect call.
Three opcodes.

The "type" way is a load, compare, perhaps a switch statement (which
is an indirect jump), and a direct call.

You take a "big" hit for the compare/switch because it always checks
for out-of-bounds cases, so you end up with a lot of compares and
jumps, which are bad for performance.

Overall, not much difference, but C++ is a bit faster.

HOWEVER, from *our* point of view, it's looks like this:

Adding a new object in C++ means editing one file.

Adding a new object in C means editing *all* the files that have such
a compare/switch in them.

I've done this in PCB and it's a nightmare.  Each time I do that, I
consider switching to C++ OOP.  I suspect the maintenance payoff will
be very short.


More information about the geda-user mailing list