Sun 03 Dec 2006

Yay for optimizing

Friday evening: 21 seconds page load time. Blimey, that's no good. It's fortunate that I'm getting better at developer kiai, or it might have spoiled my evening (the company holiday party: yaay Tainted Love!). I knew that this was a naïve first-draft implementation, and there was plenty of room for improvement.

Saturday and Sunday nights: after thinking, deducing a partial cause, implementing a solution that keeps more stuff in memory, profiling, identifying a real cause, and memoizing it: millisecond page load times with the same data (which is somewhat designed to stress the system).

I'm much happier. My design intentionally enforces the immutability of a lot of its data, so in-memory caches and memoization are a natural approach.

Never compute something a thousand times when you can compute it once! (Another: never compute something when you need it if you can compute it sooner.)

Posted at 2006-12-03 22:26:38 by RichardLink to Yay for optimizing
Comments, trackbacks.

Google
Web holygoat.co.uk
  • richard is: