Optimization is a lifestyle…

Situation 1

I was in a supermarket a few days ago and I watched the young guy in front of me place his basket on the floor and use one hand to transfer his shopping from the basket to the till. It was a painfully slow process to watch and resulted in him repeatedly exposing his butt crack. Not good.

When it was my turn, I placed my basket on the metal plate at the back of the till and used two hands to transfer my shopping. I had:

  1. Reduced the latency of the operation. Each item was traveling between the basket and the till faster due to the reduced distance.
  2. Increased the bandwidth. I was able to transfer 2 items at a time (sometimes more if I could scoop stuff out). Look mom, I’m parallelized.
  3. Kept my butt hidden from view.

Situation 2

The previous incident got me thinking about a summer job I did when I was at university. My job was to pack items coming off a production line into crates. The process was:

  1. Walk to the corner of the room.
  2. Pick up an empty crate from a pallet.
  3. Walk back to the end of the production line.
  4. Fill the crate with product.
  5. Pick up the full crate.
  6. Walk to the corner of the room.
  7. Put down the full crate on a pallet.
  8. Goto 2.

My solution to this was to have the pallets moved next to the end of the production line, thereby eliminating steps 1, 3 & 6. Unfortunately the performance improvement kinda backfired as some of use ended up having to do less interesting work to keep ourselves busy. Sorry to all those people who ended up having to help the butter unpackers because of me. 🙁

The Moral of the Story

If you don’t want to unpack butter all day, leave the pallets in the corner of the room… No… That wasn’t it… Oh yeah…

A lot of the time optimization and performance tuning is really simple. Look at what you are doing and ask yourself:

  • Do I really need to do this?
  • Is this the best way to do it?
  • How can I get back to packing crates instead of unpacking butter?

Cheers

Tim…