[OT] Re: (That C++ is slower thing again) Re: the damned GUI - was:[PD] Pd in white on black and OSC

Larry Troxler lt at westnet.com
Sun Nov 23 22:52:14 CET 2003


On Sunday 23 November 2003 13:22, Marc Lavallée wrote:
> On Sun, Nov 23, 2003 at 05:57:09AM -0500, Larry Troxler wrote:
> > I don't agree that for an equivalent program, it is slower than C.
> > I was actually optimistic that you would actually provide some examples
> > (I don't mind at all being proved wrong).
>
> Maybe we should move this discussion to the dev list, but it might be
> interesting to some other people.
>
> Here's a very simple exercise; it doesn't prove that C is necessarely
> better than C++, but it shows that code compiled with g++ produces bigger
> executable code than gcc, and that C++ code produces even bigger code than
> C code compiled with g++.
>

<snip stdout example>

Ok, to nitpick, you're comparing the standard libraries here, and not the 
performance of the language itself.

> Googling around, I found this page about C vs C++ performance:
> http://www.eventhelix.com/RealtimeMantra/basics/ComparingCPPAndCPerformance
>.htm The analysis basically says that C++ add some overhead that can be
> reduced.

Really? It says that for you? To me, it says that C++ adds some overhead (not 
quite the right word) which, if you were coding in C, you would have to add 
anyway.

Larry





More information about the Pd-list mailing list