How I fell into the trap of premature optimization, the root of all evil.