3 ms·
Re: regex, I was referring to some of the other C++ implementations: https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=gpp&id=4 http
by dikaiosune 11y ago
Re: regex, I was referring to some of the other C++ implementations:
https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=gpp&id=4 https://benchmarksgame.alioth.debian.org/u64q/program.php?te...
https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna&lang=gpp&id=3 https://benchmarksgame.alioth.debian.org/u64q/program.php?te...
I have no idea whether it's the regex implementations that are causing the comparative slowness, to be honest. Just seemed interesting that some C++ implementations using what I would think are common techniques fall behind many other languages' implementations.
Of course, benchmarks are always arbitrary, and some of them will just disadvantage approaches that would be perfectly realistic ways to solve "real-world" problems, so it's always a grain-of-salt situation. However I'm not sure it's necessarily fair to say that "C++ should be at least as fast as C for any fair benchmark." Doesn't that expose you to the danger of redefining fair benchmarks as "those benchmarks which reinforce my preconceived notions of which tools have what performance characteristics"?
- petke 11y agoProbably bad wording by me. Cpp vs c has been benchmarked so extensively that it would be big news if C was quicker than Cpp at anything. Cpp is often faster though because of inlining of templates. Finally c is mostly just a subset of cpp. Its difficult to see how compiling the same code would be slower with a cpp compiler.