|
|
|
|
|
by dahart
1068 days ago
|
|
True partly because shared_ptr is a relatively new language feature; I’ve been locked to a ~decade-old C++ compiler for most of my professional career, and so has everyone I know, just because support for a current compiler across platforms at any given time has been historically so spotty. It seems to be improving at the moment. > it won’t be idiomatic I just looked at the first example: C: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... C++: https://benchmarksgame-team.pages.debian.net/benchmarksgame/... The C++ doesn’t use shared_ptr or STL or anything, and isn’t that far from the C code, but it isn’t that close either. I wonder if it’s OMP configuration that’s causing it to be slower, or maybe just instruction cache or something since the C++ is larger. The results say this one has C++ going 50% slower. I’m a little skeptical it’s the compiler’s or the language’s fault. I’d speculate it might have more to do with how the program is written. |
|
The "Energy Efficiency across Programming Languages, SLE’17"authors provided this repo —
https://github.com/greensoftwarelab/Energy-Languages/blob/ma...
https://github.com/greensoftwarelab/Energy-Languages/tree/ma...
For a single outlier (regex-redux) there's a 12x difference between the measured times of the selected C and C++ programs.
Even so, that mostly messes up the results because the arithmetic mean is used rather than the median.
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...