4 ms·
> The main disadvantage of tracing profilers implemented in this way is > that they introduce a fixed amount for every function call / line of code > execut
by richardwhiuk 9y ago
> The main disadvantage of tracing profilers implemented in this way is
> that they introduce a fixed amount for every function call / line of code
> executed. This can cause you to make incorrect decisions! For example, if
> you have 2 implementations of something – one with a lot of function calls
> and one without, which take the same amount of time, the one with a lot of
> function calls will appear to be slower when profiled.
I'm not convinced this is the main disadvantage of tracing profilers. The main disadvantage is that the perf impact tends to be much more severe.
It's theoretically possible to mitigate the problem identified (keep track of how much time you spend profiling, and reduce the time tracked spent in the function by that amount). However, it's harder to have a tracing profiler which only profiles some functions, and harder to specify those.
The nice thing about sampling profiles is that it's very easy to configure the performance impact and easy to get a good sample by just running for longer.
- masklinn 9y ago> The main disadvantage is that the perf impact tends to be much more severe. That is an annoyance but not an issue. A 3x performance degradation, or even a 10x one, can be very annoying. But that performance degradation is uneven means profiling is unreliable, and that's a problem I've had semi-frequently with tracing profilers: the function call counts are reliable, but the timings/percentages aren't always, and you may see a hotspot under profiler, optimise it to the hilt, run without profiling and… nothing changed. Because the hotspot was mostly a profiler artefact.
- unwind 9y agoPlease don't indent, it doesn't work to make block quotes. The qoute is very hard to read on mobile. Use asterisks around the paragraph, that renders as italics. Thanks.
- gsich 9y agoUse landscape mode.