12 ms·
C++ advocates often talk about the performance gains. The problem with that is that what C++ buys you is not better performance or even predictable performance,
by dfox 9y ago
C++ advocates often talk about the performance gains. The problem with that is that what C++ buys you is not better performance or even predictable performance, but repeatable performance, which is not that useful for anything not hard-realtime.
For typical large OO codebase some kind of tracing GC is almost always better than various reference counting and tracking schemes. For the unpredictability the problem has to do with the fact that even simplest C++ statement might cause the compiler to generate several kilobytes of inlined code.
- kazinator 9y agoC++ only has repeatable performance if used in certain ways. > various reference counting and tracking schemes. Reference counting doesn't always have repeatable performance. Maybe for a program image started from scratch on exactly the same non-real-time input. But then almost anything has repeatable performance for that, including ordinary mark-and-sweep garbage collection.
- dfox 9y agoMy point was that only reason to use C++ is when you want repeatable performance which implies that you will not do things that are against this goal (and in fact C++ makes various tricks to achieve this goal trivial, eg. per-timestep heaps) My other point was that for anything other you do not want to use C++. Edit: and also "when used in certain ways" is exactly the problem with C++ I tried to point out. The language and it's interactions with real implementations is simply too complex for any kind of useful analysis.