.net - Ignoring GC while profiling (sampling) an application -


I have a VS In 2012, I am outlining an application using sampling (although profiler does not make much difference). I have a good edge over where there is a lack of performance, however, I am interrupted by the fact that lots of memory allocation is going on, and the garbage collector is important for my profiling (I see some GC effect to some extent I am in CLR Profiler and Concurrency Visualizer).

Is there a way to get rid of the sample obtained in any way? I can use any of these:

  • One GC is running, while ignoring collected samples (filter by function pointer)?
  • Giving different time and actually working time
  • Increase the boundaries of GC to effectively "stop it" for profiling.
  • Actually turn off GC

    The problem is that I do not know much about what I need to adapt, in the efforts to optimize GC by reducing allocation etc. There was very little effect on release versions without engaging the debugger, so I I really want to know how many profiling results are due to disabling adaptation etc., and how much code it will be improved (the code in question is used by a large portion of our projects, so too 10% More impact).

    I will suggest turning back and how it works here: < P> There is a speed bug in your program. (It is not very likely there is not there.) You can find it and fix it, you will save some excerpts. Suppose it is 50%.

    This means that if you run it under the IDE, and stop it manually when you are waiting for it, you will get a 50% chance when you close it on time You'll save a call stack on the call stack, look at every line of code and maybe data, see what it's doing and why it's doing.

    Do this a few times like 5 times, 10, or 20 depending on what you see. You will perform speed bugs on these specimens about 50%, guaranteed .

    This will tell you a few things that the proffer will not do, like:

    • If the speed bug is that you will see lots of new S, you can avoid reusing objects, it will show you the exact line) where this is happening, and the reasons why the sampling profiler can give you line-level inclusive time, but it will give you Can not tell the reason to spend time, and come without knowing the reason However, you can not ensure that you do not need it. OTOH, if sample land in GC, ignores it and searches for new , because new is also expensive and it causes GC.

    • If the speed bug is that you are actually accessing some files I / O or the network or sleeps deep within the regularity of a library you do not know, So it will tell you why and why, and you can understand that the sampling profiler in a way around it will not tell you because it is a "CPU profile", which means that whenever your program is blocked it Sleeps. If you switch to the instrumental promoter, it will not give you line-level precision.

      If you try this then you may have to bear some ridicule, but it will happen get the results you want If you find that 50% of the speed fix the bug, the program will be 2x faster, making the bugs easier to find in more speed, for example, if initially 50% There was a bug, now this is 50% one, and if you find it and you fix it, then you get 4 X will be faster This can surprise you that you can move forward in such a way that you can not do any more, and then you can be close to optimal.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -