Are all profilers slowing down significantly?

The profilers I come across (mainly the Digital Mars D profiler that comes with the compiler) seem to slow down the execution of the profiled program significantly. This greatly affects my willingness to use the profiler, as it makes profiling the "real" launch of many of my programs, unlike testing on very small inputs, impractical. I'm not very good at how profilers are applied. Is there a serious (> 2x) slowdown when profiling to a large extent a fact of life, or are there profilers who shun it? If this can be avoided, are there any quick profilers for D, preferably for D2, and preferably for free?

+5
source share
4 answers

I don’t know about D-profilers, but there are usually two different ways that a profiler can collect profiling information.

The first is with the help of tools, by injection of registration calls all over the place. This slows down the application more or less. Usually more.

The second is sampling. The profiler then interrupts the application at regular intervals and checks the call stack. This does not slow down the application at all.

The drawback of the sampler is that the result is not as detailed as using the profiling tool.

, . Google "" "".

+15

way way, . , . -, . . , , , .

10 20 , , , . -, , , . , , 10 . , , -, , .. .

, , . , , . , ( , ), - , , .

"" , . . , . , , , , , , - , .

, .

, , , , , , , ? , . , , , , , .

+2

, , , - , , .

+1

h3r3tic xfProf, . , :)

:

If a program selects only a few hundred (or thousands) times per second, performance overhead will not be noticeable.

+1
source

All Articles