Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(profiling): use faster, persistent caching strategy #2316

Closed
wants to merge 31 commits into from

Conversation

morrisonlevi
Copy link
Collaborator

@morrisonlevi morrisonlevi commented Oct 16, 2023

Description

This adds DD_PROFILING_WALLTIME_ENABLED which doesn't currently disable wall-time profiles completely, it only cancels the timer. You can still trigger them manually, which is partly the purpose: we want to disable automatic collection so we can benchmark in a controlled way.

It then uses a new caching strategy which will speed up stack walking in two ways:

  1. The strings don't need to be copied during the stack walking. The reads from the string table can be done from the thread doing the aggregation.
  2. The run-time cache is reset every request, but for things in opcache we can do better as those live in immutable shared memory.

Readiness checklist

  • Changelog has been added to the release document.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.

realFlowControl and others added 4 commits October 12, 2023 10:03
This doesn't currently disable walltime profiles completely, it only
cancells the timer. You can still trigger them manually.
@morrisonlevi morrisonlevi added the profiling Relates to the Continuous Profiler label Oct 16, 2023
@morrisonlevi morrisonlevi added this to the future milestone Oct 16, 2023
@morrisonlevi morrisonlevi requested a review from a team as a code owner October 16, 2023 09:20
@pr-commenter
Copy link

pr-commenter bot commented Oct 16, 2023

Benchmarks

Benchmark execution time: 2023-11-01 20:43:26

Comparing candidate commit 508fc72 in PR branch levi/overhead-bench with baseline commit f99eb9c in branch master.

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

scenario:walk_stack/1

  • 🟩 wall_time [-4.416µs; -4.412µs] or [-36.308%; -36.279%]

scenario:walk_stack/50

  • 🟩 wall_time [-6.804µs; -6.801µs] or [-44.097%; -44.082%]

scenario:walk_stack/99

  • 🟩 wall_time [-6.799µs; -6.795µs] or [-44.097%; -44.070%]

scenario:walk_stack_instructions/1

  • 🟩 instructions [-61.2K instructions; -61.2K instructions] or [-60.922%; -60.907%]

scenario:walk_stack_instructions/50

  • 🟩 instructions [-62.2K instructions; -62.2K instructions] or [-60.842%; -60.833%]

scenario:walk_stack_instructions/99

  • 🟩 instructions [-62.4K instructions; -62.4K instructions] or [-60.904%; -60.903%]

profiling/tests/overhead/web1/index.php Outdated Show resolved Hide resolved
@morrisonlevi morrisonlevi modified the milestones: future, 0.93.0 Oct 18, 2023
@morrisonlevi morrisonlevi changed the title feat: add DD_PROFILING_WALLTIME_ENABLED feat: add DD_PROFILING_WALLTIME_ENABLED for testing Oct 18, 2023
@morrisonlevi morrisonlevi modified the milestones: 0.93.0, future Oct 18, 2023
@morrisonlevi morrisonlevi marked this pull request as draft October 18, 2023 13:14
@morrisonlevi morrisonlevi changed the title feat: add DD_PROFILING_WALLTIME_ENABLED for testing perf(profiling): use persistent caching strategy Oct 27, 2023
@morrisonlevi morrisonlevi changed the title perf(profiling): use persistent caching strategy perf(profiling): use faster, persistent caching strategy Oct 27, 2023
@morrisonlevi morrisonlevi deleted the levi/overhead-bench branch May 31, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☠️ do-not-merge/WIP profiling Relates to the Continuous Profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants