Anders Both <an********@hotmail.com> wrote:
Does someone knows links to web-pages, or book contatining, information
about the most important things to consider, while trying to make the .NET
code perform faster.
e.g. In my code I make big use of ArrayList and Hashtable, but my code would
be only a little bit more complicated, if using normal Arrays. I feel like a
thing like that maybe could improve performance ?
What are they most important things to consider ?
In my opinion, the most important things to consider are:
1) The readability of the code
2) The correctness of the code
3) The maintainability of the code
4) Does your code perform "well enough"?
For the most part, changing from the collections to arrays will give
you *some* speed improvement, but it may well not give you much, and
may well reduce readability considerably.
If lots of the things you're storing/accessing are value types, you
would save a bit more, as using arrays you wouldn't need to be
boxing/unboxing the whole time.
If you feel your app isn't performing well enough, make sure you know
where the bottleneck is, and focus on improving that bit of code. Use a
profiler or even just rough-and-ready timing to try to find the
bottleneck (profiling will be more reliable, but more expensive).
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too