Determining the source of high performance processor

I added the ICQ # library (this is open source) to my application. But if I connect to the ICQ server, although it is, it will increase CPU usage (up to 30%). So the ICQ # library uses so much processor. But I do not know how to determine what it is and to reduce CPU usage.

+4
source share
3 answers

If it is open source and you have added code to your project; run it using the profiler.

+2
source

The easiest way is as follows:

  • Run the program in the debugger.
  • And go to the debugger at some point.
  • Look at the call stack, wherever you are.
  • repeat steps 2-3

Doing this just two or three times gives you a very good idea of ​​where most of your runtime is spent. If most of the execution time is spent on one function, then this function will be in the call stack almost every time you enter the debugger.

0
source

I find it in icq_sharp \ IcqSharp.Util \ Timer.cs file. See Function: private void DoWorker() . There is a cycle without delay. Just add Thread.Sleep(100);

0
source

Source: https://habr.com/ru/post/1445561/


All Articles