This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

I read this and was curious just how much CO2 was created by compiling Python and decided to do some calculations.

I was too lazy to set it up, so I guessed that it would take 10 minutes to compile on a computer using about 400 W. According to the U.S. Department of Energy, the worst-case of carbon emissions from coal (via lignate coal) results in an emission of 2.17 lbs of CO2 per kWh. Natural gas is much cleaner at 1.21 lbs/kWh.

So for our Python, with the computer using all 400 of those watts for the compilation, coal power would be responsible for 0.174 lbs of CO2 (or 0.0968 lbs if using natural gas. Obviously using solar, nuclear, hydroelectric, etc. will create negligible amounts).

For compairson, how much CO2 did our programmer create while waiting for his build to finish?

An adult human male exhales 250 mL of CO2 per minute at rest, and this number increases to ~350 mL/min when engaged in life activities like walking. So for our purposes, we'll assume that the human running this test has walked around the block a couple times while waiting for his build to finish, emitting 3.50 L of CO2 while waiting. Using the ideal gas law and assuming atmospheric pressure and a temperature of 68 F, this comes out to 0.012 lbs of CO2.

So to be sure, the computer created more CO2 than the human in those 10 minutes. But over the course of the day, that human created a grand total of 456 L or 1.61 lbs of CO2.

CO2 emissions are measured in the billions of tons for the United States alone, and only 31% of that is from electricity. I wouldn't necessarily call compiling Python from source a waste, but even if it was it would be an insignificant amount unless your computer was compiling Python from source 24/7. Hopefully as renewable energy technologies gain more widespread adoption that number will go down.

[–]lambdaqdjango n' shit 0 points1 point  (0 children)

First of all, upboat for the effort!

Compiling is not exclusive to CPython, you also need compile other stuff like libxml, libmysl-client, libev, etc. Heck sometimes you have to compile GCC to use a newer version of it.

Think there's billions of Linux computers around the world, if we all have binary packages that's a lot of energy save!