Skip to content

[IGNORE] PR 5719#5793

Draft
vpellan wants to merge 3 commits into
masterfrom
community/pr-5719
Draft

[IGNORE] PR 5719#5793
vpellan wants to merge 3 commits into
masterfrom
community/pr-5719

Conversation

@vpellan
Copy link
Copy Markdown
Contributor

@vpellan vpellan commented May 20, 2026

⚠️ DO NOT MERGE ⚠️

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 20, 2026

👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description.

If changes need to be present in CHANGELOG.md you can state it this way

**Change log entry**

Yes. A brief summary to be placed into the CHANGELOG.md

(possible answers Yes/Yep/Yeah)

Or you can opt out like that

**Change log entry**

None.

(possible answers No/Nope/None)

Visited at: 2026-05-20 13:39:38 UTC

@dd-octo-sts dd-octo-sts Bot added integrations Involves tracing integrations tracing labels May 20, 2026
@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 Bot commented May 20, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 97.07% (-0.03%)

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

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented May 20, 2026

Benchmarks

Benchmark execution time: 2026-05-21 09:59:35

Comparing candidate commit 6fe7cc9 in PR branch community/pr-5719 with baseline commit 50fc341 in branch master.

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

# We don't quite understand yet _why_ the crash happens, but using the `object_id` instead of the object
# itself seems to work around whatever's going wrong inside the VM.
def resolve(value)
cache_key = value.object_id
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue with this is, unless the return value of super below is guaranteed to hold onto value then the cache won't hold onto value at all. And that means, value can GC while still "being part of the cache semantically". Which then could mean another object could use the same object_id and the cache would return incorrect results.

It seems in Ruby 3.2+ object_id is an increasing number so probably it wouldn't get reused until fully wrapping around:

$ ruby -ve '10.times { p Object.new.object_id }'
ruby 3.2.11 (2026-03-27 revision 5483bfc1ae) [arm64-darwin25]
60
80
100
120
140
160
180
200
220
240

It still feels rather brittle to me.

Also getting the object_id is actually an extra hash lookup on 3.2: https://github.com/ruby/ruby/blob/ruby_3_2/gc.c#L4767
That's fixed to be an object field on master, but either way it's also gonna cause some extra memory usage and shape polymorphism (shapes with and without object_id will be seen at given instance variable accesses in source code, which makes such code slower, especially in the interpreter which only has a monomorphic cache).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I should have posted on #5719 probably, where a similar concern has been raised.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We could change the cache to hold on to a pair [original key, actual value], but I've been chatting with @vpellan that after we "stop the bleeding" we really need to do is understand a bit more what's being cached exactly and why, since we're handwaving a lot around this code and I think we need to get back to being confident we exactly know why it's needed and what's it's doing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations Involves tracing integrations tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants