[PD] [offtopic] Re: That C++ is slower thing again

Mathieu Bouchard matju at sympatico.ca
Sun Nov 23 20:05:45 CET 2003


On Sun, 23 Nov 2003, Jerome Etienne wrote:

> nevertheless your argument doesnt hold in its formulation, c++
> has more overhead at running time that C, an overhead which reduce
> its speed. if you write the 20% of code which use 80% of the time
> in C, and the 80% of your code which use 20% of the time in c++,
> your code *IS* slower, simply in a negigeable way. 
> if you write all your code in C, your c++ code is as fast as C 
> code, it is pure c, no more c++ even if it is embedded in 
> a .cpp file.

Dude, almost all C++-specific features have been designed with no overhead
in mind, beyond the one at compile time.

The most common "runtime overhead" there is is method-lookup, when you use
the "virtual" keyword. But still, reproducing the concept of virtual
methods in C using function pointers is unlikely to be faster than C++'s
built-in support for them.

I'd be extremely curious to know what are those slower parts of C++ that
you are talking about. I mean, identify specific features that are
slow...

> it is a rather pedantic arguement which doesnt intend to start any
> flame war,

If it really were "pedantic" it would come with more details and more
research.

And even though you say you don't want to start any disputes, if your
claims are considered very disputable (or even plain wrong) then they are
likely to attract rebuttals anyway.

________________________________________________________________
Mathieu Bouchard                       http://artengine.ca/matju





More information about the Pd-list mailing list