Skip to content

ci(benchmarks): migrate microbenchmarks from benchmarking-platform into the repo - #4486

Closed
igoragoli wants to merge 5 commits into
masterfrom
augusto/php-microbenchmarks-in-repo
Closed

igoragoli wants to merge 5 commits into
masterfrom
augusto/php-microbenchmarks-in-repo

Conversation

@igoragoli

@igoragoli igoragoli commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Currently, microbenchmarks are split across multiple repositories, with Docker images living in benchmarking-platform; and benchmarking code/scripts in both benchmarking-platform and dd-trace-*.

This creates friction and complicates maintenance for LP teams, product teams, and the perf team.

Here's the dd-trace-php branch on the benchmarking-platform repo.

APMSP-4182 All microbenchmarks are migrated directly to dd-trace-* repositories

What

Simplify the microbenchmarking setup by moving all code to this repo, along with documentation on how to best use and maintain the setup.

(AI-generated):

  • .gitlab/benchmarks/container/ — the CI image Dockerfile, copied verbatim from the BP dd-trace-php branch.
  • .gitlab/benchmarks/steps/ — the 8 run/analyze/upload/comment scripts, copied verbatim. Only change: internal /platform/steps/... references are rewritten to $(dirname "$0")/... so the scripts find each other in-repo (the scripts cd around, so plain relative paths don't work).
  • .gitlab/benchmarks/bp-runner.yml, bp-runner.fail-on-regression.yml — the experiment and gate configs, verbatim except the two /platform/steps/ references, now repo-root-relative.
  • .gitlab/benchmarks.yml — the micro jobs no longer clone benchmarking-platform: they put .gitlab/benchmarks/steps/ on PATH and call the steps by name, and point bp-runner at the local configs. The check-big-regressions clone (and its git insteadOf rewrite that only existed to serve the clone) is gone.
  • In-repo image build — build-ci-images.template.yml is included, BASE_CI_IMAGE_SUFFIX=dd-trace-php-${CI_PIPELINE_ID} and BASE_CI_IMAGE_CONTAINER_DIR=.gitlab/benchmarks/container are set, and the manual build-benchmark-ci-images job runs in the benchmarks stage. The micro image variable is renamed BASE_CI_IMAGE → MICROBENCHMARKS_CI_IMAGE so it can't collide with the template's own BASE_CI_IMAGE global (dd-trace-js does the same).
  • MICROBENCHMARKS_CI_IMAGE is pinned to the in-repo-built tag dd-trace-php-152770667 (see Testing).
  • .gitlab/benchmarks/README.md documents how to add/update a benchmark, mark one flaky, rebuild the image and run the suite locally; it replaces .gitlab/BENCHMARKS.md (nothing referenced the old file). .claude/ci/benchmarks.md statements about the clone-based layout are updated.
  • Out of scope, unchanged: the php/laravel-realworld macro suite and the php/data-streams-monitoring DSM suite still clone benchmarking-platform.

Testing

(AI-generated):

  • Independent evaluator (fresh-context agent) verdict: 6/6 PASS on the playbook's checklist.
  • Logs grep clean: every error/warning hit is classified noise (fabric-egress boilerplate, git-cache fallback, build warnings in pre-existing extension code, boto3 Python 3.9 deprecation, benchmark_analyzer alias deprecation). All four phpbench runs report Failures: 0, Errors: 0.
  • Artifacts parse with sane values: baseline and candidate CSVs and 6 converted JSONs (112 scenarios, 222 metrics), plausible magnitudes, baseline ≈ candidate.
  • All 102 tracer scenario series on the BP API contain a point from the run's pipeline (152882166), same scenario names; misses are only suites that did not run on this branch (appsec, profiler, macro), same as before.
  • check-big-regressions: "ALL GOOD! No big regressions are detected (larger than 10.00%)!". The PR comment step posted without error.
  • grep -rnE 'git clone.*benchmarking-platform(\.git)?( |$)' .gitlab/ returns only the macro (php/laravel-realworld) and DSM (php/data-streams-monitoring) clones, both unchanged from master.
  • All copied files verified byte-identical to the BP branch except the prescribed path rewrites; YAML and bash -n pass on the changed files; the copied step scripts are executable (100755).

…to the repo

Copy container/, steps/ and the bp-runner gate configs verbatim from the
benchmarking-platform `dd-trace-php` branch into `.gitlab/benchmarks/`
(only change: the copied scripts' `/platform/steps/...` references now
resolve in-repo), and stop cloning the platform in the microbenchmark
jobs:

- `benchmarks-{tracer,appsec,profiler}` and `check-big-regressions` call
  the steps from `.gitlab/benchmarks/steps/` and point bp-runner at the
  local configs.
- The micro image is built in-repo from `.gitlab/benchmarks/container/`
  via the `build-ci-images.template.yml` include (manual
  `build-benchmark-ci-images` job, new `ci-image` stage in the generated
  child-pipeline stage list); the micro image variable is renamed
  `BASE_CI_IMAGE` -> `MICROBENCHMARKS_CI_IMAGE` so it doesn't collide
  with the template's `BASE_CI_IMAGE`. The old BP-built tag stays pinned
  for this PR's pipeline and is repinned to the in-repo-built tag on top.
- New `.gitlab/benchmarks/README.md` documents add/update/flaky/local
  run; replaces `.gitlab/BENCHMARKS.md` (nothing referenced it).

The macro (`php/laravel-realworld`) and DSM (`php/data-streams-monitoring`)
suites still clone benchmarking-platform and are unchanged.
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 58 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.6] — ❄️ 31 known flaky tests · 🔄 may pass on retry

View more details · View in GitLab

↳ ❄️ Known flaky: Zend/tests/oom_exception_trace.phpt (OOM: Exception constructor doesn't reach hard limit while fetching backtrace) from php.Zend.tests

↳ ❄️ Known flaky: ext/phar/tests/webphar_cgi_no_path_info.phpt (Phar::webPhar() double free in CGI when SCRIPT_NAME is set but PATH_INFO is absent) from php.ext.phar.tests

↳ and 29 more — View all
DataDog/apm-reliability/dd-trace-php | ASAN test_c: [8.6, arm64] — ❄️ 2 known flaky tests

View more details · View in GitLab

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/fibers/fiber_observer_bailout.phpt (Test fiber observing with bailout) from php.tmp.build_extension.tests.ext.fibers

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/sandbox/install_hook/trace_closure_instance_still_shared_ge_php_86.phpt (HOOK_INSTANCE caching boundaries for PHP 8.6 static cl... from php.tmp.build_extension.tests.ext.sandbox.install_hook

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [8.6] — ❄️ 3 known flaky tests

View more details · View in GitLab

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/autoload-php-files/ignores_fatal_errors.phpt (Request init hook ignores fatal errors) from php.tmp.build_extension.tests.ext.autoload.php.files

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/sandbox/fatal_errors_are_tracked_002.phpt (E_ERROR fatal errors are tracked from hitting the memory limit) from php.tmp.build_extension.tests.ext.sandbox

↳ and 1 more — View all

View all 58 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

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

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 596c31b | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-11-13 15:21:15

Comparing candidate commit 596c31b in PR branch augusto/php-microbenchmarks-in-repo with baseline commit 2d3e2b7 in branch master.

📊 Benchmarking dashboard

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

Unstable benchmarks

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

scenario:LaravelBench/benchLaravelDdprof-opcache

  • unstable execution_time [-667.863µs; +1698.583µs] or [-4.619%; +11.749%]

@igoragoli

Copy link
Copy Markdown
Contributor Author

Superseded by #4506: that PR carries the migration and the bp-runner conversion in one signed commit on master, verified end to end (evaluator 7/7, parity with the script-driven run).

@igoragoli igoragoli closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant