Re:Energy Efficiency Across Programming Languages
by igouy on Saturday September 16, 2017 @01:56PM
(#15265723)
> … and one reason why it calls itself a "game"…
No: http://benchmarksgame.alioth.debian.org/sometimes-people-jus...
> … and disavows usefulness for actual programming language comparisons…
Not a definitive conclusion but a starting point.
And for any synthetic microbenchmark, that's unlikely to reflect real-world workloads, as they tend to narrowly test just one aspect of the language (or rather, its implementation).
Remember, we're talking about a peer-reviewed paper here, where the burden to show relevance is upon the authors. Section 4 ("Threats to Validity") of the paper does not really address that adequately.
As the Computer Language Benchmark Game site itself quotes (and one reason why it calls itself a "game" and disavows usefulness for actual programming language comparisons):
You can construct pretty much arbitrary rules that will arbitrarily favor certain implementations over others. For example, the rules could also say to only use the language's built-in allocation mechanism for this benchmark. Or you could construct a benchmark that would heavily favor languages with built-in JIT techniques.> You can do object pools in GC'd languages, too, for example.
No. The rules do not allow for that. I did mention how arbitrary they are, right? The regex-redux benchmark, for example, comes down to what the best external library is that you can link to under the rules. The gcc version wins in large part (being massively better than the g++ version, which relies on Boost regexes) because it uses the JIT version of libpcre. It's borderline absurd.
> generics? Not C++ specific.
You said templates, not generics. Generics alone are not necessarily sufficient to implement pool allocators. Plus, C++ is the only language that has major adoption that has both some form of generics and manual memory management.
> That example results in terrible fragmentation for everyone if M > N other than a compacting GC. It's not made particularly worse by an object pool.
This is false. Even a simple first-fit allocator can fare better, for example. Obviously, a compacting GC can avoid external fragmentation (almost) entirely, no matter the cause.