3 ms·
That a compiled program runs faster, that is, requires less cpu cycles and consequently uses less energy, is not a very surprising result. This comparison basic
by _ph_ 6y ago
That a compiled program runs faster, that is, requires less cpu cycles and consequently uses less energy, is not a very surprising result. This comparison basically then just benchmarks the different compiler outputs for the given test cases. Benchmarking is always difficult and often controversial, especially when drawn from the benchmarking game. Consequently, C not only wins in the speed but also the energy category.
But that is only testing the run time of a program. What this paper does not cover, is for example the energy needed to compile the program and of course, the energy needed to write and debug the program. The whole reason not to write "everything" in C is, that there is a real-life tradeoff between having the fastest possible program which also would be the most efficient, and the effort to create it. Higher level and dynamic languages have been created to create correct programs with less effort. Mostly of expensive programmers, but development time obviously goes along with energy usage for the development machine, compiler runs, debugging effort.
- ByteJockey 6y agoSure, but for anything long running or potentially just long lived that gets run a lot, the chart would approach roughly this one.
- _ph_ 6y agoYes, the longer the program runs, e.g. the kernel of a computer, the more the overall energy consumption approaches the ranking listet in the paper, as far as those benchmarks are meaningful. They are not very good about dynamic memory allocation in long-running programs though.
- tlamponi 6y agoWe write server software, running 24/7 by hundreds of thousands of server, so even double the development time on a single machine would be easily offset hundreds to thousand folds by a more efficient executable. But, you even need to go to C if you would like to achieve that, e.g., using rust gives you nice level of abstractions and is highly efficient.
- _ph_ 6y agoRight, there are many languages, which give you "good enough" efficiency but are much better suited for development and stability.