Saturday, January 12, 2013

Small efficiencies

One of the rules for a good life is to look after yourself, to spend a little time making your world better, so you can enjoy life better. The same applies to work: it's worth looking at the unnecessary little inefficiencies in your workflows, and removing them, in order to make things run more smoothly.

When I'm developing code for my PhD project, I upload it to a server in the University for testing. I'll do this repeatedly as I code, testing each bit of code as I write it. For a typical feature, I would do this at least 10-20 times. Each time, I save my file, switch across to my terminal, and run an rsync command. It prompts for a password, I type it in, and then it spends about 20 seconds uploading all the code. In total, probably at least an extra 30 seconds each time I want to test a bit of code. I quick look at my terminal history shows I've done this 281 times. That's a conservative estimate; the system only keeps 500 lines in my history file, but just that is over two hours of my time transferring content - a whole evening's work. I've known for ages that I should streamline this, but each evening, it's a case of (a) spend 5-10 minutes figuring out ssh and rsync magic, or (b) spend 30 seconds uploading my code and get on with the evening's work. I've chosen the lazy, 30 second, option so far.

I finally bit the bullet this evening, and did the streamlining - I set up the authorized_keys file on the testing server for ssh, and added a "-u" to the rsync command. My code upload now takes 1.2 seconds, and I don't have to type in any passwords at all (and these improvements don't need to be re-done - they stay in place permanently). Took me 5 minutes reading through the documentation to get it going. Life is better. Sometimes, playing around with  productivity improvements can be a time waster, but the little things like this add up, and really are time savers in the long run.

No comments:

Post a Comment