Saturday, July 16, 2011

Artful Observation

Now that you've slept with that little software baby of yours for the past three months (or past year) you may feel confident that you actually know how it works. Do us all a favor though friend and patiently watch it run. And no I don't mean by peering over the shoulder of the user or by firing up a remote server-session to view the batch-log scroll by.

No, really watch it. Turn on the full eight-hundred-million candlepower searchlight and glare that baby down to its bones. Numerous tools enable visibility to the hardware utilization; you can even configure the lowly task-manager to show such useful metrics as GDI objects, memory use, CPU, page faults, threads, and network activity (the big six resources).

Is your process pegging a CPU? Do you have a memory leak? Did you fail to deallocate objects? Are you performing way more disk IO than you need to? Are you losing control of the quantity of threads that you are spawning? Are you hosing the network? Well maybe you should fix it!

During the heat of design and development it's certainly less demanding to code things for quick creativity that end up just wasting resources. Code that runs efficiently, however, is also code that allows for scalability. Raise the bar on the quality of your work: refactor those resource-hogs and take the time to seriously watch your application run.