2

I have created a Winforms app in C# . What I'd like to know is how optimized/resource-demanding my app is. How much memory and cpu power it is dragging and so on. I have tried to look at the Task manager and tried Visual Studio's Analyzer . Is that enough? Or there are better ways to do so?

arvind
  • 189
  • 3
  • 19

3 Answers3

3

According to the way you've asked about analyzer tools, I'm pretty sure that you won't need any performance or management optimization. For that reason I'd like to start with a quote of Donald Knuth regarding optimization:

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.

So if you can't tell which part of your software is to slow - you most likely don't need to optimize it. Only optimize if you know that something is slow, e.g. your UI is freezing when clicking ButtonA or whatever. After that you'll want to run a performance analyzer and for the cases I needed to dig into my softwares performance, VS-Analyzers were far enough. Performance optimization is well discussed here.

Most things I said about performance optimization can be applied to optimizing memory-management. The only thing that I'd explicitly look into is memory-leaks, because MemoryLeaks are bugs - and you should try to keep your software bug-free. In my opinion its way harder to find memory-leaks than performance bottlenecks, because you won't really feel them, whereas you do feel slow performance. A good tool for tracking down memory-leaks is dotMemory. It could be quite interesting to track down some leaks using WinDbg, since that gives you some insight into how GarbageCollection (rooted objects vs. unrooted)works .

Community
  • 1
  • 1
Jonas
  • 82
  • 1
  • 8
1

Click Debug -> Start Performance Analysis. Shortcut is Alt+F2.

Analyze -> Profiler -> New Performance Session

Adam
  • 2,422
  • 18
  • 29
0

You can only measure performance against requirements. And the requirements should state KPIs for function execution times in specific conditions because an application could be fast with few user connected but very slow when used under the normal load. Everything else is a waste of time.

cristian v
  • 1,022
  • 6
  • 8