4 ms·
I think he means that if you keep optimising a C++ program, or certain part of it, you eventually get to something very close to C, thus with similar energy and
by laurent123456 5y ago
I think he means that if you keep optimising a C++ program, or certain part of it, you eventually get to something very close to C, thus with similar energy and memory consumption. But indeed that's the problem with that kind of comparison - what's being compared exactly? How optimised is each program?
- loeg 5y agoNo, I think RSC means that C89 programs are literally valid C++ programs, and more recent C dialects nearly so.
- int_19h 5y agoBut C89 programs aren't literally valid C++ programs, either. Although I can't see any reason why those differences would affect performance. With newer C versions, there is "restrict", which can lead to better optimizations. And VLAs to avoid some heap allocations (albeit at the cost of potential stack overflow).