Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
stages:
- benchmarks
- benchmarks-report

include: ".gitlab/benchmarks.yml"
38 changes: 30 additions & 8 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
variables:
BASE_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-cpp
BENCHMARKS_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-cpp

benchmarks:
stage: benchmarks
when: on_success
tags: ["runner:apm-k8s-tweaked-metal"]
image: $BASE_CI_IMAGE
image: $BENCHMARKS_CI_IMAGE
interruptible: true
timeout: 15m
script:
- export ARTIFACTS_DIR="$(pwd)/reports" && (mkdir "${ARTIFACTS_DIR}" || :)
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/"
- git clone --branch dd-trace-cpp https://github.com/DataDog/benchmarking-platform /platform && cd /platform
- ./steps/capture-hardware-software-info.sh
- ./steps/run-benchmarks.sh
- ./steps/analyze-results.sh
- "./steps/upload-results-to-s3.sh || :"
- "./steps/post-pr-comment.sh || :"
- git clone --branch dd-trace-cpp https://github.com/DataDog/benchmarking-platform /platform
- export PATH="$PATH:/platform/steps"
- capture-hardware-software-info.sh
- run-benchmarks.sh
- analyze-results.sh
- "upload-results-to-s3.sh || :"
- "post-pr-comment.sh || :"
artifacts:
name: "reports"
when: always
paths:
- reports/
expire_in: 3 months
Expand All @@ -30,3 +32,23 @@ benchmarks:

KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-cpp
FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: "true"

check-big-regressions:
stage: benchmarks-report
needs: [ benchmarks ]
when: on_success
allow_failure: false
tags: ["arch:amd64"]
image: $BENCHMARKS_CI_IMAGE
script: |
export ARTIFACTS_DIR="$(pwd)/reports/"
if [[ -n "$CI_JOB_TOKEN" ]];
then
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/"
fi
git clone --branch dd-trace-cpp https://github.com/DataDog/benchmarking-platform /platform
export PATH="$PATH:/platform/steps"

bp-runner /platform/bp-runner.fail-on-regression.yml --debug
variables:
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-cpp
13 changes: 13 additions & 0 deletions src/datadog/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ Span Tracer::create_span(const SpanConfig& config) {
auto defaults = config_manager_->span_defaults();
auto span_data = std::make_unique<SpanData>();
span_data->apply_config(*defaults, config, clock_);

// PERFORMANCE REGRESSION: Add expensive computation to simulate heavy workload
// This will cause significant performance degradation in span creation
volatile std::uint64_t regression_work = 0;
for (int i = 0; i < 1000000000; ++i) {
regression_work += (i * i) % 997; // Use a prime modulus for more work
regression_work += regression_work * 31; // Additional computation
}
for (int i = 0; i < 1000000000; ++i) {
regression_work += (i * i) % 997; // Use a prime modulus for more work
regression_work += regression_work * 31; // Additional computation
}

span_data->trace_id = generator_->trace_id(span_data->start);
span_data->span_id = span_data->trace_id.low;
span_data->parent_id = 0;
Expand Down