Managed code needs to be be interpreted or JIT-ed at runtime.

At first glance it seems to me that in general it is more energy consuming to interpret/compile the program on every user's computer than to compile it once and distribute binary code that can be run without any further processing...

So does that make compiled languages more environmentally friendly than managed languages?

Is the difference significant?

  • 1
    $\begingroup$ What is "managed" code? For that matter, what is "non-managed" code? $\endgroup$ – Andrej Bauer Jan 22 '19 at 14:23

I think there might be a misconception. Managed code doesn't necessarily have to be interpreted or compiled on each user's computer.

Significance is in the eye of the beholder. The technical question would be, what is the percentage increase in energy consumption caused by language A vs language B? That will depend on the two languages in question, and the program you're considering, but you could measure it using standard benchmarking techniques. Then, whether that difference is significant or not will be a matter of opinion.


As a theoretical matter (this is CS, not Engineering) the run-time generation of executable code has a possible benefit of choosing more energy-efficient constructs that might not universally be available. Consider CPU variants with and without hardware support for encryption - a software implementation will be less efficient.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.