Skip to content

[PROF-15377] Profiling: Disallow heap profiling on Ruby 4.1+ (master)#6023

Merged
ivoanjo merged 1 commit into
masterfrom
ivoanjo/disable-heap-profiling-ruby41
Jul 14, 2026
Merged

[PROF-15377] Profiling: Disallow heap profiling on Ruby 4.1+ (master)#6023
ivoanjo merged 1 commit into
masterfrom
ivoanjo/disable-heap-profiling-ruby41

Conversation

@ivoanjo

@ivoanjo ivoanjo commented Jul 10, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR disables heap profiling on Ruby 4.1+ (e.g. current Ruby master).

Motivation:

Our current implementation of heap profiling relies on ObjectSpace._id2ref, which was removed on Ruby 4.1 -- see
https://bugs.ruby-lang.org/issues/22135 .

Until we can re-implement the feature differently, we have no way of supporting 4.1+

Change log entry

Yes. Profiling: Disallow heap profiling on Ruby 4.1+

Additional Notes:

N/A

How to test the change?

Change includes test coverage.

**What does this PR do?**

This PR disables heap profiling on Ruby 4.1+ (e.g. current Ruby master).

**Motivation:**

Our current implementation of heap profiling relies on `ObjectSpace._id2ref`,
which was removed on Ruby 4.1 -- see
https://bugs.ruby-lang.org/issues/22135 .

Until we can re-implement the feature differently, we have no way of
supporting 4.1+-

**Additional Notes:**

N/A

**How to test the change?**

Change includes test coverage.
@ivoanjo
ivoanjo requested review from a team as code owners July 10, 2026 14:00
@dd-octo-sts dd-octo-sts Bot added the profiling Involves Datadog profiling label Jul 10, 2026
@datadog-official

datadog-official Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 0.00%
Overall Coverage: 90.04% (+0.01%)

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

@pr-commenter

pr-commenter Bot commented Jul 10, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-10 14:25:13

Comparing candidate commit dbb880b in PR branch ivoanjo/disable-heap-profiling-ruby41 with baseline commit 9d01d28 in branch master.

📊 Benchmarking dashboard

Found 1 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 1 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 ----------------------------------'

scenario:profiling - intern mixed existing and new

  • 🟩 throughput [+1.734op/s; +2.398op/s] or [+5.864%; +8.111%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:tracing - trace.to_digest - Continue

  • unstable throughput [-1826.190op/s; +1313.910op/s] or [-6.270%; +4.511%]

@ivoanjo
ivoanjo requested a review from eregon July 13, 2026 07:59
@ivoanjo
ivoanjo merged commit 7ac9482 into master Jul 14, 2026
588 checks passed
@ivoanjo
ivoanjo deleted the ivoanjo/disable-heap-profiling-ruby41 branch July 14, 2026 12:05
@dd-octo-sts dd-octo-sts Bot added this to the 2.38.0 milestone Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Involves Datadog profiling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants