Performance testing
I make a living designing the performance and testing guidelines that are almost adopted universally now.. I should of patented it all but quite honestly common sense can not be patented...(ie: Amazon's one-click process)
However - I always seem to get dragged into micro-benchmarks and all I have to really say on the matter - they are micro. Seems a bit hard to sandwich I guess but micro benchmarks and real-world application benchmarks are two different beasts. For example - you use string builder in a 3rd or 4th level child control to display a href link. Honestly - calling a method where you may be tossing around a huge object just to calculate the href link may be overkill. In other words the String Builder is more efficient but only when it is being called within the calling assembly (naturally depending on the level and depth).... \\
The issue I have with micro benchmarks is they are only accurate if you assume everything is being executed within the same context. The further out you go to call a supporting method or class is really a issue of convenience and not necessarily performance..While the called upon method may be more performent - if you are passing x number of objects through a layer of assemblies... the perf benefits get nullified...MIcro-benchmarks only concentrate on iterating through a method but not necessarily th effects of being used in normal programming scenarios..
While micro benchmarks are an excellent way of getting base resulots they should not be relied upon to determine the overall performance of a application. Especially when the such called invocations will be called n-layers down..
The other issue I have with micro benchmarks is the wow XXXX% gain over not using this alternative. Again we are looking at a specific isolated case and forgetting the 'environmental factors'. In terms of the whole performance of an application - micro benchmarks provide literally no substantiating data unless the test is performed within the guidelines of what the application dictates...
I love to prove things wrong - it is my business model - but ........... common sense does have to be an including factor of why you adopt programming the X way over the Y way. Sometimes it simply doesn't matter...Sometimes concentrating on such low level aspect prevents you from recognizing the higher level programming issues you are having...........
Just be forewarned...there are always consequences no matter how you program - it is the ability to reduce the impact - reasonably- that impacts the overall performance of any application..