|
This article is ostensibly about how the current implementation of namedtuples has had serious consequences for the startup time of Python, because namedtuples are used in the compilation of classes (roughly). However, somehow this buries the lede...the most "interesting" discussion is kicked off by the first comment: Issues around the performance of Python and programs
written in it have far wider consequences than startup
time. During all the time any Python program is running,
its host machine is consuming power that typically depends
on pumping CO2 into the atmosphere. If most of that power is
wasted, the effects go far beyond extra money to buy
it, or to operate extra servers, or users who wait a
little longer. The carbon footprint of a Python program
that runs throughout a data center, or many data centers,
adds up.
There was an article earlier on HN about the energy consumption pattern of Bitcoin/Ethereum and presumably any blockchain that implements a proof-of-work protocol/scheme, and between that article and this comment - I've started to notice a growing unease (I am probably waaay behind on the uptake) about the "world-eating" capacity of software.I wonder how quantifiable implementation decisions like the ones exhibited by namedtuples in Python, which one might argue is an unfortunate/accidental side-effect vis-a-vis energy consumption, versus ones like proof-of-work, which I would argue are explicitly designed to be expensive. And if anything should come of that quantification, namely, does optimizing code really become a moral imperative, and if so are there some usability and refactorability metrics that are often held in high regard that we ought to consider abandoning in the name of "energy efficient" software. Obviously, this isn't a simple tradeoff, software that is difficult to write because it is highly optimized is difficult to maintain, and it might be the case that performance derived energy savings are outweighed by the energy cost of maintenance (literally, the energy cost of debugging and testing). |
The amount of effort that can be spent on optimizations on this kind of widely used software is enormous before the balance becomes negative. If an optimization that shaves off 1 second of CPU time used per year on each of a million devices will result in a net reduction in energy usage within the first year even if it takes 30 eight hour work days to develop.
This train of thought becomes particularly nasty when you realize that all the computational overhead introduced by the widespread usage of encryption (https etc.) must necessarily lead to environmental damage. To put it in the most provocative way I can think of right now: which is more important: the security of your personal data now or the safety and wellbeing of future generations of humankind?