Nice guys finish last, but we get to sleep in.
Prelude
If, like me, you get your TV fix via the intertubes (aka the-not-entirely-legal-but-the-way-it-should-be) you’ll encounter the .rar-fileformat. Nothing special about rars, they’re like zips but better, they compress to smaller files and take less time doing so. I mostly do my unrarring in batch (aka I’ve downloaded the episodes of a new season and want to unpack all of them). And so we come to the problem: this makes my macbook stutter.
Overture
What causes stuttering ? Either the CPU (think of Flash as an example) is being used intensively or the IO (think of copying multiple files at the same time) is doing too much. So I googled this and like most of my google searches nowadays, I already knew the answer.
Back when I was still an avid SETI-user, it was a cool screensaver at the time and the concept (cloud computing using the internet) was still is great, I used nice to make SETI not clobber the CPU.
Main theme
Nice allows you to alter the priority of an application, this is probably an oversimplification but it fits our purposes. Now to bring the prelude and overture together:
nice -n 15 unrar e The.Sopr.Errr.Show.That.May.Not.Be.Named.part1.rar
Now unrar will assign itself almost the lowest priority (20 is the lowest, -20 is the highest) and you can enjoy stutterfree computing while unrar chucks along.
Notes
- I don’t really remember where I got the unrar binary from, but you (probably) could extract it from UnrarX.app
Do this :
nice -n 20 ./Applications/Safari.app/Contents/MacOS/SafariThen go to a Flash site and watch it stutter
- My next post will be about screen, a real gem to know.