4 ms·
Presumably execution efficiency, but tbh I don't think I've ever seen any compelling numbers. The inefficiencies from extra human time would likely offset any p
by packetlost 3y ago
Presumably execution efficiency, but tbh I don't think I've ever seen any compelling numbers. The inefficiencies from extra human time would likely offset any potential gains from the pennies you'd save on CPU costs.
- behnamoh 3y ago> Presumably execution efficiency, ... Yeah, in that case Assembly/C is the greenest language but should we switch to them? > The inefficiencies from extra human time would likely offset any potential gains from the pennies you'd save on CPU costs. I'm not sure I follow what you mean here.
- kazinator 3y ago> Yeah, in that case Assembly/C is the greenest language but should we switch to them? We've not switched away.
- packetlost 3y agoThe electricity gains to be had are likely very small. Minuscule, even. Humans are not ecologically neutral, we consume food that has environmental impacts. Depending on diet and other lifestyle (physical activity, for example) factor into a humans ecological impact. By increasing the amount of time a human spends on something, you proportionally increase the ecological impact of the task the human is performing. The idea is that duplicating or redoing work may be more costly in aggregate, but absolute terms to the environment than the small offset in energy to be had by making the code more efficient. The point isn't about the absolute numbers, it's just trying to illustrate that the numbers are so small that it might as well be a rounding error unless you're talking about industry or society-levels of impact, which Clojure does not really have.
- brabel 3y ago> The electricity gains to be had are likely very small. Minuscule, even. That's just wrong. Electricity used by data centers today add up to the whole consumption of a largish country. If you can save even just 5% of that, it's an enormous difference. Companies like Google and Netflix spend millions to save much less than that in computing.
- packetlost 3y agoIf only it were that simple! If such a gain could be made by simply switching your programming language to one that is "more efficient" (in power consumption terms) we would see Google writing everything in C++, instead of the mix of Go, Python, Java, PHP, etc. that comprises most of their software stacks! But no, that's not how it works at all. Nearly half (about 40%)[^1] of datacenter's total power draw on average is from cooling, which is usually shared across every server in the datacenter. Next, about 30%[^2] of the average server's power draw comes from its CPU (this obviously varies, even at different times on the same server), most servers sit at about 50% utilization on average. So already we're looking at 50% of 30% of 60% = 9% total of energy consumption going to the CPU with very rough, over-estimations. Now Clojure makes up about 1.25% of code, ish[^3]. Let's round that up to 1.5% to be generous. So a reeeeally rough estimate has Clojure code taking up 0.135% of total datacenter power usage globally assuming averages for pretty much everything. I had trouble finding benchmarks for Clojure vs. Common Lisp, but Clojure is basically just Java at runtime, so this[^3] will do. Benchmarks are kinda silly, but we're talking about really average performance. The benchmarks I could find had Java beating SBCL on most benchmarks, but let's say you stand to gain a generous 20% efficiency by using SBCL over Java. That leaves you at a 0.027% gain in efficiency with a lot of generous rounding and assumptions. Now, of course most code is not CPU constrained... you get the idea. The efficiency gains are not much at all. [^1]: https://davidmytton.blog/how-much-energy-do-data-centers-use/ https://davidmytton.blog/how-much-energy-do-data-centers-use... [^2]: https://www.researchgate.net/publication/355862079_A_Review_of_Data_Centers_Energy_Consumption_And_Reliability_Modeling https://www.researchgate.net/publication/355862079_A_Review_... [^3]: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/lisp.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- refset 3y agoAssuming current multi-tenant infrastructure trends continue, over-provisioning of RAM and slow start up times are likely the much bigger efficiency issues.
- brabel 3y agoEverything you said is a waste of your time. I am not talking about replacing Clojure with Common Lisp. Why did you even come up with that strawman?? The point is that if everyone used more efficient languages, a very large reduction in energy costs could be expected (not just in data centers by the way, every device takes power, and the ridiculously inefficient apps people are running probably cost a lot of energy). It's the same argument as to why you should have a ecofriendly house or whatever: you try to do your part and hope the others will do too. You may be cynic enough to think that makes no difference, but you're just blind to your own unjustified prejudices.
- bigstrat2003 3y ago> The electricity gains to be had are likely very small. Minuscule, even. Humans are not ecologically neutral, we consume food that has environmental impacts. A human who spends his day writing code is going to consume (at worst) the exact same amount of food as if he spent only half his day coding and the other half on something else. He might even consume less food while coding, if his non-coding activity is something physically intensive (i.e. burns more calories). I don't really see how the implication (that saving human time saves energy too) can possibly be true.
- fulafel 3y agoAlso, paying more or less for the development effort has environmental impacts from the resulting economic activity - slower/harder development makes the software cost more, the downside from co2 foorprint pov is that whoever did it buys more plane tickets to holidays, second cars, etc. (Depends on the domain of the app if it would have been better to finish sooner or later from environmental pov)