Showing posts with label database. Show all posts
Showing posts with label database. Show all posts

Thursday, August 25, 2011

What's the right time to Optimizing your code?

Some people claim that it is always better to defer tuning until after the coding is complete. This advice will only make sense if your team's coding is of a high quality to begin with, and you already have a good feel of all the performance parameters of your application. Otherwise you will be exposing yourselves to the risk of having to rewrite substantial portions of your code after testing.

My advice is that before you design a software application, you should do some basic benchmarks on the hardware and software to get a feel for the maximum performance you might be able to achieve. Then as you design and code the application, keep the desired performance parameters in mind, because at every step of the way there will be tradeoffs between performance, availability, security and flexibility.

Also choose good test data. If your database is expected to hold 100,000 records, avoid testing with only a 100 record database – you will regret it. This once happened to me; we did not detect the slow code until much later, causing a lot of wasted time as we had to rewrite a lot of code that worked but did not scale.

What do you think. Any comments on this post is much appreciated.