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

mark mark at junklight.com
Mon Nov 24 11:19:14 CET 2003

"Strange. "Many years ago" I coded for EPROM as well, and weirdly, it was
the corss-compiler vendors that were slow to offer C++, while I was
constantly bugging them about it. This is kind of interesting, since you
apparently knew embedded systems programmers that didn't want C++. Perhaps
they were really hardware engineers who soft of evolved into doing software,
and even the concept of using C and not assembler was very experimental in
their minds."

Ha Ha - spot on! I learned a lot from working with them though. Very bizarre
meet people who can do mental arithmetic in hex as well. Racing car
are a strange bunch at the best of times and all a bit obsessed - you should
the things they did to their casings - drilling away all material they
excess. Great place to work though. 

"Even though stuff like dynamic allocation was irrelevant at the time, I
sure could have used the syntactical, organizational help that C++ offers,
when doing those 128KB - 512KB ROMs.  I think that paradoxically, it was
because I was so size and speed conscious, that I was in tune with what the
compilers were generating, that I realized that using C++ would have been a
great design-time convenience, whithout imposing run-time cost. "

And this was indeed my argument too :-) 

"No, I disagree with you here. C++ is not "marginally slower than C;". But
statement is of course quite vague "

I was simply making a concesion to the fact that C++ occasionally has the
odd extra
pointer de-reference which in some peoples minds that slows it down. You are
correct though - by the time its been optimised etc. it makes no difference
at all. 

"But for most practical purposes, C++ is the same as C as far as run-time 
performance is concerned. At least, from a theoretical point of view, this 
_must_ be true - both C and C++ are compiled, statically typed, languages. 
Maybe some computer science graduate could verify or refute this

Not sure how you would go about proving it but my (many) years of experience

bears this out. 



More information about the Pd-list mailing list