What your computer does while you wait (and how to make it go faster)

http://duartes.org/gustavo/blog/post/what-your-computer-does-while-you-wait For the many people who wonder why the computer takes so long to respond even while it's not 'doing anything' (myself included). Of particular interest, while your computer may operate mainly within close caches and system memory, reading data or code from the hard drive can take up to approximately 164,000 times as long as reading from main memory, and about 13.6 million times as long as reading from the fastest cache available to processors. Of course, this is the initial seek time, and is much slower than what are called 'sustained reads', where a large block of data is read at the same time. Think of it as travelling across the world to read something out of a book. Reading the first word takes 12 hours, but reading the next word is much faster.

Much research has gone into reducing hard drive reads, as many software architecture and operating systems professors/books can attest, and the reality of the situation is much better than the bolded numbers might suggest. Compact, well-written applications coupled with large and nimble CPU caches and main RAM can reduce the number of hard drive reads and writes to a minimum, but it still happens. Those hard drive hits crush the performance of any application, and keeping data in line and ready to be read can really improve performance.

This performance hit is felt the most during system boot, when nothing is cached in memory. Your computer has to load the basic core of Windows/Linux/Mac, followed by drivers, services, and other essential processes that allow you to use the computer. All of these require many seeks to the hard drive to get the files into memory, then into the CPU, and it hurts. The same effect is exhibited when computers resume from sleep or hibernate, where some or all the memory has been written to the hard drive and must be pulled back into memory at the comparatively excruciatingly slow pace that hard drives run at. So when you unfold your laptop, the computer is unresponsive for a few seconds as all the data is read back into memory while processes are trying to restart where they left off.

To combat that evil seek time, some computers (such as the MacBook line) have Solid State Drive options. These work just like RAM (although quite a bit slower, but not near as bad as hard drives), in that there is very little seek time! So when your system boots, all the files it needs can be loaded quickly without seeking all over the hard drive, easily speeding up system performance!

Sadly, solid state drives are hard to come by for desktops, and are normally just laptop drives in desktop casings, so my desktop will sit with standard seeking hard drives for the foreseeable future.

Things I've learned

Just got back from a trip to Cancun for the weekend, and I've learned a few things:

  • No matter how technologically advanced we get as a civilization, you still need to carry a pen.
  • Laws should be written with some semblance of intelligence assumed in the people. Things move a lot quicker.
  • I appreciate the ability of US Airports to publish their gate number assignments more than 50 minutes before flight time.
  • I can appreciate why people get buzzed socially. Still don't know if I enjoy it that much, though.
  • It's quite possible to walk around for 10 minutes and find 8 different USD-MXN exchange rates. It is also mathematically impossible to make any money playing the exchanging game between those vendors.
  • The US Dollar is starting to suck.
  • When relying on SPF50 suntan lotion, be sure you get every square inch of your body. I have an interesting sin(x)/4x shaped line down my back (with the 0 near my right shoulder)
  • If you're going to visit a foreign country, at least attempt to learn some aspect of the language before you visit. Baño, bien, y tu, para ti, and gato only take you so far.
  • Bodyboarding is still freakin awesome.
  • As is snorkeling. We saw 3 dolphins in 30m deep ocean!
  • Take more shirts then you think you'll need.
  • The intracity buses in Cancun are 6.50 MXN, roughly 60 cents US. Freakin nuts!!

There's probably a few more, but those are the ones I remembered to write down on my phone between planes.