Skip to content

refactor(profiling): remove locks and simplify PROFILER_NAME_STR/PROFILER_VERSION_STR#3998

Merged
realFlowControl merged 3 commits into
masterfrom
levi/lazylock-cleanup
Jun 18, 2026
Merged

refactor(profiling): remove locks and simplify PROFILER_NAME_STR/PROFILER_VERSION_STR#3998
realFlowControl merged 3 commits into
masterfrom
levi/lazylock-cleanup

Conversation

@morrisonlevi

Copy link
Copy Markdown
Collaborator

Description

In a recent PR we refactored to use LazyLocks instead of lazy_static macros. While reviewing that, I suspected these could remove the lazy lock altogether and be made const. It's true, we can, but it was not as "idiomatic" as I expected. Nonetheless, I think it's an improvement.

Note that if we panic, it will be at build time, as these are const contexts.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@morrisonlevi morrisonlevi added the profiling Relates to the Continuous Profiler label Jun 17, 2026
@morrisonlevi morrisonlevi requested a review from a team as a code owner June 17, 2026 22:42
@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jun 17, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 5 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [7.1]   View in Datadog   GitLab

Profiling ASAN/UBSAN Tests | PHP 8.5 zts UBSAN (arm-8core-linux)   View in Datadog   GitHub Actions

DataDog/apm-reliability/dd-trace-php | Amazon_Linux_2_arm64.SID0: [test-app-php-container-83]   View in Datadog   GitLab

View all 5 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.12% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8d86c8d | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 17, 2026

Copy link
Copy Markdown

Benchmarks [ profiler ]

Benchmark execution time: 2026-06-17 23:06:56

Comparing candidate commit 8d86c8d in PR branch levi/lazylock-cleanup with baseline commit a8cd140 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 28 metrics, 8 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

@realFlowControl

realFlowControl commented Jun 18, 2026

Copy link
Copy Markdown
Member

The failing UBSAN is fixed in upstream krakjoe/parallel#381

@realFlowControl realFlowControl merged commit b21cc23 into master Jun 18, 2026
2142 of 2155 checks passed
@realFlowControl realFlowControl deleted the levi/lazylock-cleanup branch June 18, 2026 05:33
@github-actions github-actions Bot added this to the 1.22.0 milestone Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants