RE: Compiling C++ modules

David Schwartz
2006-05-03T20:52:33Z

> >In the bad old days, performance was the number one priority because
> >computers were slow and resources were scarce

> And that is still *very much* the case on huge numbers of systems
> running Linux --> Embedded systems <---

Yes and no. Any embedded system likely to run a full Linux kernel today has
at least ten times the performance and resources of the computers from the
bad old days.

The majority of embedded systems that run very low-end hardware perform
tasks where performance is not particularly important anyway (microwave
oven, elevator). Those that perform more sophisticated tasks generally have
correspondingly more impressive hardware.

In my experience, reliability is much more important than performance in
most embedded systems. If C++ results in cleaner and better organized code,
for some particular piece of code, it would be madness to choose C out of
fear that C++ will perform worse. (Of course, that's a big 'if'.)

In fact, in all the years I developed embedded systems (from industrial
knitting machine controllers to medical devices) I can't remember a single
project where performance was the number one priority, or even a
particularly high one. Feature set, reliability, development cost and time,
ease of use, and the like were typically way ahead of performance. Perhaps
for a router or something like that it would be different. But I do not
believe that embedded systems in general are a class where performance is
more important than elsewhere.

There are small embedded operating systems that are written primarily in
C++.

DS