dd-trace-php icon indicating copy to clipboard operation
dd-trace-php copied to clipboard

WIP: feat(profiling): track profiler overhead

Open realFlowControl opened this issue 2 years ago • 2 comments
trafficstars

Description

This PR aims to track the overhead of profiling. This is currently in PoC phase 😉

Readiness checklist

  • [ ] (only for Members) Changelog has been added to the release document.
  • [ ] Tests added for this feature/bug.

Reviewer checklist

  • [ ] Appropriate labels assigned.
  • [ ] Milestone is set.
  • [ ] Changelog has been added to the release document. For community contributors the reviewer is in charge of this task.

realFlowControl avatar Oct 06 '23 10:10 realFlowControl

I'm just playing with ideas currently. Instead of adding a new sample for every sample that we create we might be able to attach to the sample currently created, which means we are not doubling the number of samples. It has some drawbacks, as we do not measure the entire round trip and we are for example missing the time it takes to try_send() the sample to the other thread. We are btw. still able to surface these in the timeline, even when the times are in another sample type

realFlowControl avatar Oct 06 '23 14:10 realFlowControl

Benchmarks

Benchmark execution time: 2023-11-08 15:47:48

Comparing candidate commit 78bce3b5df87165efc40fe4c3bc39156022a1403 in PR branch florian/track-overhead with baseline commit a1f35f6952cff87f5e4c31ee5534eee76d91bcac in branch master.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 16 metrics, 3 unstable metrics.

scenario:php-profiler-timeline-memory-with-profiler-and-timeline

  • 🟥 max_rss_usage [+1.468MB; +1.764MB] or [+5.064%; +6.086%]

scenario:walk_stack/1

  • 🟥 wall_time [+280.727ns; +284.433ns] or [+2.310%; +2.341%]

pr-commenter[bot] avatar Nov 08 '23 15:11 pr-commenter[bot]