Reply to Message

Of course efficiency is a compromise
If you don't want to keep recalculating or even retrieving a value you cache it.
So you've made your code faster, but increased the amount of required resource.
Keep going down that route, and eventually you have a piece of code that takes a long time to throw an out of memory exception. Or thrashes the page file, or uses up so much of your machine, you can't do anything else.

Optimisation might have been a better choice of word, scalability, naff all to do with it.
Posted by Tony Hopkinson
15th Jun 2011