Monday, February 06, 2012

Hot processing!

Great story from Ken Holman, quoted for coolness and also for #refrigerator...

Hot processing!
So I'm standing here at my desk preparing my UBL 2.1 PRD3 D1 package and I have two very long XSLT transformations to run. One takes 98 minutes and the other takes 124 minutes, running in Java in BSD on my Unibody MacBook 2.66GHz I7 (dual core; quad process). Input file 10Mb; output files total 183Mb.
I used to run these two tasks sequentially, but I today checked out "Activity Monitor" and discovered that while each transformation starts off using about 250% CPU time (sharing processors while building the memory structures), they quickly become single processor 100% (±2%) only (while traversing the memory structures).
So I decided to run them simultaneously instead of sequentially, saving me (theoretically) close to 98 minutes since most of the time appears to be at 100% and when they are both running Activity Monitor says they are both running at 100%.
So far so good ... but within minutes the fans on my machine get too noisy to talk over! I check the status bar and, sure enough, both fans are running >6000rpm. My fans so very rarely make any noise, so this is very noticeable and annoying.
My very wise wife suggests I go to the kitchen and get the flat-bottomed aluminum frying pan to place under my machine, upside down so the flat part of the pan is full on the bottom of the Mac. Maybe two minutes later the fans are running <4000rpm and we can talk without raising my voice over the fan.
Well, now as I'm typing this Google+ post the frying pan is getting hot! The fans are up to 4800rpm again and slowly rising.
So, I've just gone to the kitchen, brought out a second aluminum frying pan, put that one under the Mac, and put the first frying pan into the refrigerator to cool down for the next swap. Within a minute the fan is back down <4000rpm.
My review and editing of the above takes five or 10 minutes. Already this pan is heating up as it isn't as substantial as the first pan ... fan speed up to 4400rpm ... but the first pan will be cold by the time I need to swap again.
Such a simple improvement! Wish I'd thought of it.
View or comment on Piers Hollott's post »

No comments: