4 ms·
Huh? It measures 2 idiomatic ways to print a string. Printf is faster, it's expected. This is just a note checking common sense. Totally worth doing it, especia
by vkazanov 4y ago
Huh? It measures 2 idiomatic ways to print a string. Printf is faster, it's expected. This is just a note checking common sense. Totally worth doing it, especially for a scientist!
PS The author is... not just any professor.
- pjmlp 4y agoLast time I checked my C++ compiler also had support for printf.
- vkazanov 4y agoYes, sure, C++ includes C stdlib. Don't remember arguing with this thesis.
- pjmlp 4y agoWhich makes his first example valid C++ code down to the same set of machine code as a C compiler would generate, thus a pointless article from a person that should know better.
- vkazanov 4y agoDeeper in the article there's also a comparison of cpu cycles burned on various approaches. Would that count as useful?
- pjmlp 4y agoNot when he lacks the understanding his C code is plain valid C++ code as well. He could have avoided writing all that nonsense by using a C++ compiler on his "C" code with 100% the same machine code being generated.