Optimizing for Fan Noise
prog21.dadgum.com
prog21.dadgum.com
I know CPU throttling is possible on many notebooks in Linux. Do any Mac users out there know of such a feature in OS X?
I think that sentiment is closer to what the article was trying to get across.
Windows offers pretty good configuration options for power management, including setting maximum processor speed (as a percentage) while running on battery or on AC.
The author seems to be blurring the lines between fixed tasks like transcoding videos and interactive tasks like games. It's not at all obvious that transcoding with a single-threaded app saves any power over the duration of the job than with a multi-threaded implementation. Most laptop CPUs don't have the kind of power gating that are on the latest chips like the Core i7, so even if no instructions are issued to a core, it still draws some power.
With interactive tasks, the only way to save power is to do less, so that the CPU and other components can spend most of their time waiting for the user while in a low-power state. Predictive caching and speculative execution increase the responsiveness of a system on average, but at the cost of performing some tasks whose results won't be used. The only real take-away from this article is that apps that might be used on the go should provide a way to disable these techniques.
(It's important to note that games don't do a lot of this stuff, so there your only options are to turn down the eye candy and the frame rate. A good example of how to accomplish this is Torchlight's netbook mode.)
The first time I read this I didn't understand it, but the author has laid a trap here for the unwary reader in the word "doubling". If you can get 4x the performance using 4 cores the energy efficiency is the same or better, but if your program scales poorly and only gets 2x performance from 4 cores the energy efficiency is worse.
Basically, you will never get a linear increase with parallel computing, especially on consumer type apps that are much more synchronous. So running multiple cores, with requisite context switches will get less computing per watt, even if it isn't as bad as the 2x number.
Can you explain this part?
His definition of "superlinear" is a bit tricky. As he explains, you can only get superlinear by "Do disproportionately less work." and/or "Harness disproportionately more resources.". However, his example of the former is actually a subtle instance of the latter.
Superlinear speedups are always due to more effective caching. Sutter uses "disproportionatly more resources" when the added effectiveness comes from larger caches. However, his "do less work" examples are "just" better cache behavior.
a) Make sure you can get your machine in a quiescent state (say, 5 minutes after bootup, all unnecessary background tasks and services are turned off).
b) Make sure ambient temperature is the same between runs.
c) Hook your computer up to a PDU with power usage monitoring built in.
d) Run automated tests, measuring power usage by the machine during the test. The automated part is important, because you want them to be fairly lengthy and also repeatable.
e) Compare results before and after. It's important to have a baseline for comparison so you know whether you're making progress or not.
In addition to this, the computer is on the floor, not right next to my ears. So even if it were louder, it would still not annoy me.
So basically, I think your computer is broken if you can hear the fans. It's either designed wrong, or in the wrong position, or both.
However, with modern processors just because they are fast that doesn't mean that programmers have to max out the processor and make it heat up. For example, I wrote an article a while back about how I increased performance in a 2D game and brought processor usage from 99% to 35% using a few graphical tricks such as trying to do alpha blending during the load (precalculated) rather than while rendering each frame:
http://experimentgarden.blogspot.com/2009/08/sdl-tile-game-w...
My homebuilt desktop is an overclocked 4GHz 8500 with a 4870 video card. It uses over 300W when pushed, but is still practically inaudible due to its water cooling and 250mm fan radiator tucked away in the corner under the desk.
http://www.silentpcreview.com/ is an excellent resource for finding low-noise hardware and designs.
At each step, the nature of the solution gets a little bit more intertwined with the details.
Parallelization becomes a tradeoff you "feel" much earlier, because you're changing things all the way up at the algorithm level.
My conclusion is that we need to vastly improve the energy density of batteries (or consider using carbon-based energy sources to power mobile devices).
Edit: Not sure why this is getting downvoted. The end of the article really does discuss mobile devices and energy dissipation - which I found to be the most critical part. Yes, the author ties it in together nicely with his anecdote of writing out code by hand. So in his day, you optimized for code length. Now, he advocates that we optimize for lower energy consumption. But I would instead, or in parallel, argue that mobile devices also simply have too little energy available to them.
You do get a nice boost when buying a replacement battery for your 2-3 year-old device...