Ignacio Machin ( .NET/ C# MVP ) said:
Hi,
I agree with Michael, yours is not the best of the attitude, or at least
the tone of the answer does not seems nice to me.
Do you mean my entirely serious and in no way abusive questioning of the
OPs motivation for looking to avoid standard classes for very low level
performance improvements?
You do have a point though, that sometimes the best code is not the
fastest , but sometimes it;s
Which is why you need to know the motivation and circumstances.
The best balance of performance and code complexity cannot be known
without having at least some idea what the actual requirements are.
In my experience in 80% of cases there is no need to make any performance
enhancement whatsoever. In 15% of cases the soultion is better algorithms
at a higher level and in the remaining 5% of cases the most cost effective
soloution is usually to require a more powerful computer to run on (It
works for Microsoft).
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nick Hounsome said:
Has anyone done any performance testing between new generic Lists and
single dimensional arrays?
I really like the code flexibility the List provides since I don't
know how many items I will have in the list. With my array approach, I
have to manage re-sizing the array myself.
So, is using List<myClass> x as fast as MyClass[] x ?
Why do you care?
Either it is fast enough for your needs - in which case you should use
it because it makes the code easier to write and maintain - or it
isn't - in which case you are in big trouble and writing your own
probably will not give you enough to save you.
I assume that you are not required to properly test your code or you
wouldn't even ask this question.