Hi,
I'm currently developing an application that uses a lot of
computational power, disk access and memory caching (to be more exact:
an information retrieval platform). In these kind of applications the
last thing that remains is bare performance tuning.
So for example, you can do an 'if then else' on a bit like a 'case/
switch', an 'if/then/else' and as a multiplication with a static
buffer. Or, you can do sorting with an inline delegate, with a
delegate and with a static delegate. Which is best in terms of raw
speed? Or should I just use reflector, fill the sort in and save time?
Perhaps I should mark my critical code 'unsafe'? Should I avoid for-
each? Or rather use it? What about 'yield'? Should I avoid exceptions?
What are real performance killers? So on...
Since I don't feel like testing every possible optimization and
thereby reinventing the wheel I wonder if someone else has already
made up a document, book or article containing all best practices
concerning low-level optimizations in C#.
Your help is appreciated.
Thanks,
Stefan.
I'm currently developing an application that uses a lot of
computational power, disk access and memory caching (to be more exact:
an information retrieval platform). In these kind of applications the
last thing that remains is bare performance tuning.
So for example, you can do an 'if then else' on a bit like a 'case/
switch', an 'if/then/else' and as a multiplication with a static
buffer. Or, you can do sorting with an inline delegate, with a
delegate and with a static delegate. Which is best in terms of raw
speed? Or should I just use reflector, fill the sort in and save time?
Perhaps I should mark my critical code 'unsafe'? Should I avoid for-
each? Or rather use it? What about 'yield'? Should I avoid exceptions?
What are real performance killers? So on...
Since I don't feel like testing every possible optimization and
thereby reinventing the wheel I wonder if someone else has already
made up a document, book or article containing all best practices
concerning low-level optimizations in C#.
Your help is appreciated.
Thanks,
Stefan.
Comment