profiling - C# How can I determine where the slow parts of my code are? -


I'm not coding for a long time, so I do not know how fast the technology is, so I was thinking that Is there a way to do this in VS or with third-party equipment?

Thanks

OK, downvoyt time ...

Profiles are great for measuring.

But your question "How do I decide where the slow parts of my code are?".

This is a different problem, it is a diagnosis, not a measurement.

I know that this is not a popular scene, but it is true.

This is a business that is trying to cut costs.

One approach (top down) is to measure overall finance, by breaking it by categories and departments, and estimating what can be terminated. This is the measurement.

Another approach (bottom up) is to walk at random in an office, take someone at random, and ask them what they are doing at that time (and important thing) Why in detail

It's more than once. This is what Harry Truman has done in the US on the outbreak of the WW2, the defense industry, and immediately exposed the fraud and waste on a large number of sites. This is a diagnosis.

In the code you can do this in a very easy way: "stop" and ask why it is spending a particular cycle, usually the call stack tells you why in detail .

It's more than once.

This sample is a sample of some professor call stack but for some reason they insist on the summary of the time involved in each event, inclusive and exclusive. It is consolidated into the business department, inclusive and exclusive.

This loses the information you need, which is a description of fine grain that tells that chakras are necessary.

To answer your question:

Just pause your program multiple times and capture the call stack every time. If your code is very slow, then useless function calls will be on almost all stacks. They will accurately point to "the slow parts of your code".

Added: Redget Anti is available there, it can give you cost-per-line, and this is quite spam. So if you are in .NET, and you can remove 3 figures, and do not mind waiting to install; To know it, it can tell you what your pausible key can tell, and it can be more beautiful about it.


Comments