Re: The Positive Legacy of C++ and Java
Posted: Mar 22, 2009 3:06 PM
> > Every little performance lost over here and there
> > accumulates and results in a slow computing experience.
> > For a single threads and a single program, perhaps it
> > not make sense. But when you have many processes and
> > threads, it matters.
> Doesn't. Not really for most programs. Efficiency
> argument is bogus today. It makes zero sense. Here is
> one example:
Nope, it does make absolute sense, when Firefox freezes from too many open tabs, when Word chokes on complex documents, when Excel does a complex calculation...it matters in compiling big projects...it matters in a lot of cases!
> This is my app. It does live music performance and MIDI
> routing. It makes an objective C object for every blessed
> MIDI event, on the heap, using copious polymorphism during
> the handling of that MIDI event (transposition, filtering,
> rechannelization) until its delivery to its destination
> audio processor. Live. Real time. Audio. With
> undiscernable latency. Using dozens of threads. It never
> stumbles even when handling multiple MIDI input devices
> and crazy keyboardists that lay on the whole keyboard at
> once. Using unoptimized Objective C. The graphics
> animation is the same (keyboard animates). If I had
> needed to optimize, I could have. But I didn't.
Nice app, but you can't win the performance argument with a single app.
> > If I can make it faster without sacrificing
> > why shouldn't I do it?
> You can't. If you need wicked fast dispatching, you
> sacrifice virtual methods (and there isn't a good way to
> undo that sacrifice without extensive rewriting of the
> classes themselves - unlike imp caching where you can
> using it with any object any time. C++ makes tons of
> sacrifices in flexibility in the name of performance.
I don't find C++ or Java inflexible. Why should I have dynamic dispatch ala Objective C when virtual methods ala C++ does the job perfectly?