Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: "Nils M Holm" Newsgroups: comp.compilers Subject: Re: Green Compiler ? Date: Fri, 28 Dec 2012 09:11:23 +0100 Organization: Compilers Central Lines: 49 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <12-12-027@comp.compilers> References: <12-12-010@comp.compilers> <12-12-013@comp.compilers> <12-12-023@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: leila.iecc.com 1356708209 40545 64.57.183.58 (28 Dec 2012 15:23:29 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 28 Dec 2012 15:23:29 +0000 (UTC) Keywords: performance Posted-Date: 28 Dec 2012 10:23:29 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:811 Anton Ertl wrote: > "Nils M Holm" writes: > >In principle, I would say that higher execution speed equals more > >green-ness. Less time spent dissipating heat means less energy > >consumed. > > If a computer runs only a given set of batch-style programs a given > set of times, yes. But that's not how computers are used. E.g., > there are games that consume all the resources they are given. If the > game code runs faster, it just means that the game has better FPS, not > that the computer consumes less energy. There are also anti-virus > programs etc., and even for batch-style programs, if they run faster, > one often runs them more often. So it's not so easy. So you are basically arguing that people always try to get the maximum out of their resources and therefore faster code is worse. Indeed, if this should be the case, you are right. Your first example was games. Why does a game *have to* use the maximum number of frames per second? When a given number of frames per second is sufficient, in the sense that additional frames will not make the video output any smoother, why increase the frame rate further? Let the program sleep between frames. In this case fast code can sleep between frames, slow code can't. Same for virus scanner: why run them more often? So I would argue that the issue you raise is a psychological one rather than a technical one. When people always want to get the maximum out of their resources, then there is no way to reduce power consumption, except, maybe, by creating *slower* processors. Creating slower compiler output would not help, because it will just burn more CPU cycles to achieve less. Faster code is better, because it achieves the same in less time. E.g.: a slow interpreter can run the same algorithm as a fast, compiled executable. Both achieve the same on the same CPU, but the interpreted code takes longer and hence wastes energy. So faster code saves energy. Of course, this point assumes that people want a fixed outcome at the least cost, and I see that this is often not the case. It seems to get more and more interesting though, with all those "green" processors, and other "green" equipment around. Bottom line: we can create the tools to save energy, but if people do not want to save energy, nothing will help. -- Nils M Holm < n m h @ t 3 x . o r g > www.t3x.org