Skip to content

fix: modernize to b.Loop#4480

Merged
darccio merged 6 commits into
mainfrom
dario.castane/ktlo/modern-bloop
Mar 4, 2026
Merged

fix: modernize to b.Loop#4480
darccio merged 6 commits into
mainfrom
dario.castane/ktlo/modern-bloop

Conversation

@darccio

@darccio darccio commented Feb 27, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Big PR but it just updates - where we don't use the index value - all the benchmark loops to the modern b.Loop.

Some specific benchmarks will use the original style to avoid measurement artifacts derived from the fact that b.Loop avoids inlining and other compiler optimizations.

Motivation

Make linter happy.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

@darccio
darccio requested review from a team as code owners February 27, 2026 14:02
@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label Feb 27, 2026
@codecov

codecov Bot commented Feb 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.87%. Comparing base (7a849eb) to head (204d961).

Additional details and impacted files

see 197 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter

pr-commenter Bot commented Feb 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-03-03 21:29:46

Comparing candidate commit 35ccebe in PR branch dario.castane/ktlo/modern-bloop with baseline commit bd8a42c in branch main.

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

scenario:BenchmarkSetTagMetric-25

  • 🟩 execution_time [-2.235ns; -1.339ns] or [-3.629%; -2.175%]

Comment thread ddtrace/tracer/option_test.go Outdated
@darccio
darccio requested a review from kakkoyun March 3, 2026 20:57

@kakkoyun kakkoyun left a comment

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.

LGTM 🚀

@darccio
darccio merged commit c0c3570 into main Mar 4, 2026
227 of 228 checks passed
@darccio
darccio deleted the dario.castane/ktlo/modern-bloop branch March 4, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs mergequeue-status: removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants