This is a read-only archive!

Orders of magnitude

Computer programming is fun because a small change is often the difference between failure and success (for various values of "success"). One way to succeed in programming is to do a task fast or efficiently. Fast can mean as fast as a human can do it. If we could find a robot that could do household chores as fast as a human and no faster, it'd still be pretty a pretty big accomplishment. Or fast can mean faster than a human can do it. If a record-keeping system isn't faster than a human using pen and paper, what's the point in using a computer? Fast can mean a matter of years. Good old number factorization; if we had an algorithm that could do it in a year for any arbitrary number, that'd still be a huge step forward from where we are. For hard problems, fast can even mean within the expected lifetime of the universe.

Today I made a very small change to one of the scripts I deal with at work, and now my data takes up 1/10th the space it used to, and as a result takes probably 1/10 as long to run because it's such an I/O-bound process. You never would've thought so, either. It shaved just a couple kb off of a couple files, but it so happens those files are produced by the thousands, so it ended up saving hundreds of megabytes worth of disk space. Good old orders of magnitude. It means when a program sucks, it sucks hard, and when it's good, it's often better than you would've expected. (And once again I have Ruby to thank.)

September 01, 2006 @ 12:53 PM PDT
Cateogory: Programming
Tags: Ruby, Rant