Scott Hanselman

Performance in General

September 14, '04 Comments [2] Posted in ASP.NET
Sponsored By

While reading EricGu’s post on Performance of Generics, I was struck by this sentence which expresses perfectly what I was trying to express to a group of programmers earlier today who were arguing about the :? operators in C# being “faster” than explicit if statements.  I called B.S. on the whole topic. Thanks Eric!

Performance is rarely dominated by small decisions, such as whether you use an ArrayList or a List<int> to store your data. It's usually dominated by algorithmic concerns - how you process data, how much redundant processing you're doing, etc. My experience is that the ability to be able to address these concerns is fairly well correlated with the resiliency of your code to change, which usually comes down to how clean and understandable the code is. If you have clean code and good tests, it is probably feasible to refactor your code to improve performance once you find out where the performance issues are.

Note that I'm not saying that you should put performance off until the end - that rarely works, as time at the end is fairly precious. I think you should focus on macro performance rather than micro performance. [EricGu]

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Tuesday, 14 September 2004 21:49:36 UTC
May I also recommend Eric Lippert's excellent "How Bad is Good Enough?":

http://blogs.msdn.com/ericlippert/archive/2003/10/17/53237.aspx
Tuesday, 14 September 2004 22:22:56 UTC
That's a great post from Lippert! I have something similar, "Why aren't my optimizations optimizing?"

http://www.codinghorror.com/blog/archives/000061.html
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.