Skip to content

Reuse TagMap.Entry objects in InternalTagsAdder#10965

Open
dougqh wants to merge 5 commits intomasterfrom
dd/pre-construct-tagmap-entries
Open

Reuse TagMap.Entry objects in InternalTagsAdder#10965
dougqh wants to merge 5 commits intomasterfrom
dd/pre-construct-tagmap-entries

Conversation

@dougqh
Copy link
Copy Markdown
Contributor

@dougqh dougqh commented Mar 25, 2026

What Does This Do

Pre-constructs TagMap.Entry objects for ddService and version tags in the InternalTagsAdder constructor, then uses these pre-built entries directly when adding tags via unsafeTags.set.

Motivation

Optimizes tag processing by constructing TagMap.Entry objects once during initialization rather than constructing them on every span processing call. This reduces object allocation overhead and improves performance for high-throughput tracing scenarios.

Additional Notes

  • The ddService field type is changed from UTF8BytesString to String as the UTF8 conversion is now handled during TagMap.Entry construction
  • Both ddServiceEntry and versionEntry are constructed conditionally based on null/empty checks in the constructor
  • The processTags method now directly passes pre-constructed entries to unsafeTags.set() instead of constructing them inline

Jira ticket: APMLP-1144

Contributor Checklist


PR by Bits - View session in Datadog

Comment @DataDog to request changes

Co-authored-by: dougqh <dougqh@gmail.com>
@datadog-official
Copy link
Copy Markdown
Contributor

View session in Datadog

Bits Dev status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-official
Copy link
Copy Markdown
Contributor

I can only run on private repositories.

@dougqh dougqh added tag: ai generated Largely based on code generated by an AI or LLM type: enhancement Enhancements and improvements tag: performance Performance related changes comp: core Tracer core and removed Bits AI labels Mar 25, 2026
@dougqh dougqh marked this pull request as ready for review March 25, 2026 18:11
@dougqh dougqh requested a review from a team as a code owner March 25, 2026 18:11
@dougqh dougqh requested a review from ygree March 25, 2026 18:11
@dougqh dougqh changed the title Pre-construct TagMap.Entry objects for tags Reuse TagMap.Entry objects in InternalTagsAdder Mar 25, 2026
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 25, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master dd/pre-construct-tagmap-entries
git_commit_date 1774632959 1774636052
git_commit_sha a1239d3 b295f57
release_version 1.61.0-SNAPSHOT~a1239d32d8 1.61.0-SNAPSHOT~b295f57894
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1774637910 1774637910
ci_job_id 1546845102 1546845102
ci_pipeline_id 104831274 104831274
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-3-laezmh7m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-3-laezmh7m 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 62 metrics, 9 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.056 s) : 0, 1056044
Total [baseline] (8.81 s) : 0, 8810245
Agent [candidate] (1.061 s) : 0, 1060904
Total [candidate] (8.863 s) : 0, 8863485
section iast
Agent [baseline] (1.228 s) : 0, 1228405
Total [baseline] (9.549 s) : 0, 9549467
Agent [candidate] (1.249 s) : 0, 1249285
Total [candidate] (9.62 s) : 0, 9620308
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.056 s -
Agent iast 1.228 s 172.361 ms (16.3%)
Total tracing 8.81 s -
Total iast 9.549 s 739.222 ms (8.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.061 s -
Agent iast 1.249 s 188.38 ms (17.8%)
Total tracing 8.863 s -
Total iast 9.62 s 756.823 ms (8.5%)
gantt
    title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.205 ms) : 0, 1205
BytebuddyAgent [baseline] (628.955 ms) : 0, 628955
BytebuddyAgent [candidate] (630.303 ms) : 0, 630303
AgentMeter [baseline] (29.309 ms) : 0, 29309
AgentMeter [candidate] (29.403 ms) : 0, 29403
GlobalTracer [baseline] (256.519 ms) : 0, 256519
GlobalTracer [candidate] (257.687 ms) : 0, 257687
AppSec [baseline] (31.778 ms) : 0, 31778
AppSec [candidate] (31.829 ms) : 0, 31829
Debugger [baseline] (59.457 ms) : 0, 59457
Debugger [candidate] (59.825 ms) : 0, 59825
Remote Config [baseline] (588.269 µs) : 0, 588
Remote Config [candidate] (588.679 µs) : 0, 589
Telemetry [baseline] (8.026 ms) : 0, 8026
Telemetry [candidate] (8.085 ms) : 0, 8085
Flare Poller [baseline] (4.219 ms) : 0, 4219
Flare Poller [candidate] (5.769 ms) : 0, 5769
section iast
crashtracking [baseline] (1.186 ms) : 0, 1186
crashtracking [candidate] (1.246 ms) : 0, 1246
BytebuddyAgent [baseline] (797.565 ms) : 0, 797565
BytebuddyAgent [candidate] (812.466 ms) : 0, 812466
AgentMeter [baseline] (11.414 ms) : 0, 11414
AgentMeter [candidate] (11.764 ms) : 0, 11764
GlobalTracer [baseline] (247.733 ms) : 0, 247733
GlobalTracer [candidate] (250.369 ms) : 0, 250369
AppSec [baseline] (26.54 ms) : 0, 26540
AppSec [candidate] (26.961 ms) : 0, 26961
Debugger [baseline] (67.729 ms) : 0, 67729
Debugger [candidate] (70.933 ms) : 0, 70933
Remote Config [baseline] (520.757 µs) : 0, 521
Remote Config [candidate] (535.685 µs) : 0, 536
Telemetry [baseline] (10.64 ms) : 0, 10640
Telemetry [candidate] (9.283 ms) : 0, 9283
Flare Poller [baseline] (3.748 ms) : 0, 3748
Flare Poller [candidate] (3.443 ms) : 0, 3443
IAST [baseline] (25.385 ms) : 0, 25385
IAST [candidate] (25.682 ms) : 0, 25682
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.058 s) : 0, 1057770
Total [baseline] (11.036 s) : 0, 11036250
Agent [candidate] (1.08 s) : 0, 1080025
Total [candidate] (11.14 s) : 0, 11139973
section appsec
Agent [baseline] (1.246 s) : 0, 1246325
Total [baseline] (11.099 s) : 0, 11098881
Agent [candidate] (1.251 s) : 0, 1251252
Total [candidate] (11.165 s) : 0, 11164994
section iast
Agent [baseline] (1.231 s) : 0, 1231389
Total [baseline] (10.561 s) : 0, 10560638
Agent [candidate] (1.237 s) : 0, 1237235
Total [candidate] (11.336 s) : 0, 11335731
section profiling
Agent [baseline] (1.18 s) : 0, 1180068
Total [baseline] (11.017 s) : 0, 11017049
Agent [candidate] (1.188 s) : 0, 1188041
Total [candidate] (11.019 s) : 0, 11019035
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.058 s -
Agent appsec 1.246 s 188.555 ms (17.8%)
Agent iast 1.231 s 173.618 ms (16.4%)
Agent profiling 1.18 s 122.298 ms (11.6%)
Total tracing 11.036 s -
Total appsec 11.099 s 62.63 ms (0.6%)
Total iast 10.561 s -475.613 ms (-4.3%)
Total profiling 11.017 s -19.201 ms (-0.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.08 s -
Agent appsec 1.251 s 171.227 ms (15.9%)
Agent iast 1.237 s 157.21 ms (14.6%)
Agent profiling 1.188 s 108.016 ms (10.0%)
Total tracing 11.14 s -
Total appsec 11.165 s 25.02 ms (0.2%)
Total iast 11.336 s 195.758 ms (1.8%)
Total profiling 11.019 s -120.939 ms (-1.1%)
gantt
    title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.226 ms) : 0, 1226
BytebuddyAgent [baseline] (629.893 ms) : 0, 629893
BytebuddyAgent [candidate] (642.755 ms) : 0, 642755
AgentMeter [baseline] (29.399 ms) : 0, 29399
AgentMeter [candidate] (30.035 ms) : 0, 30035
GlobalTracer [baseline] (256.94 ms) : 0, 256940
GlobalTracer [candidate] (261.853 ms) : 0, 261853
AppSec [baseline] (31.849 ms) : 0, 31849
AppSec [candidate] (32.485 ms) : 0, 32485
Debugger [baseline] (60.347 ms) : 0, 60347
Debugger [candidate] (61.647 ms) : 0, 61647
Remote Config [baseline] (614.074 µs) : 0, 614
Remote Config [candidate] (598.892 µs) : 0, 599
Telemetry [baseline] (7.997 ms) : 0, 7997
Telemetry [candidate] (9.065 ms) : 0, 9065
Flare Poller [baseline] (3.539 ms) : 0, 3539
Flare Poller [candidate] (3.647 ms) : 0, 3647
section appsec
crashtracking [baseline] (1.183 ms) : 0, 1183
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (658.906 ms) : 0, 658906
BytebuddyAgent [candidate] (660.85 ms) : 0, 660850
AgentMeter [baseline] (12.109 ms) : 0, 12109
AgentMeter [candidate] (12.215 ms) : 0, 12215
GlobalTracer [baseline] (257.531 ms) : 0, 257531
GlobalTracer [candidate] (258.932 ms) : 0, 258932
AppSec [baseline] (177.212 ms) : 0, 177212
AppSec [candidate] (177.928 ms) : 0, 177928
Debugger [baseline] (66.357 ms) : 0, 66357
Debugger [candidate] (66.827 ms) : 0, 66827
Remote Config [baseline] (632.556 µs) : 0, 633
Remote Config [candidate] (647.113 µs) : 0, 647
Telemetry [baseline] (8.48 ms) : 0, 8480
Telemetry [candidate] (8.347 ms) : 0, 8347
Flare Poller [baseline] (3.635 ms) : 0, 3635
Flare Poller [candidate] (3.618 ms) : 0, 3618
IAST [baseline] (24.134 ms) : 0, 24134
IAST [candidate] (24.246 ms) : 0, 24246
section iast
crashtracking [baseline] (1.174 ms) : 0, 1174
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (799.401 ms) : 0, 799401
BytebuddyAgent [candidate] (802.573 ms) : 0, 802573
AgentMeter [baseline] (11.436 ms) : 0, 11436
AgentMeter [candidate] (11.485 ms) : 0, 11485
GlobalTracer [baseline] (248.024 ms) : 0, 248024
GlobalTracer [candidate] (248.916 ms) : 0, 248916
AppSec [baseline] (27.485 ms) : 0, 27485
AppSec [candidate] (26.695 ms) : 0, 26695
Debugger [baseline] (68.019 ms) : 0, 68019
Debugger [candidate] (70.404 ms) : 0, 70404
Remote Config [baseline] (520.281 µs) : 0, 520
Remote Config [candidate] (531.561 µs) : 0, 532
Telemetry [baseline] (10.262 ms) : 0, 10262
Telemetry [candidate] (10.006 ms) : 0, 10006
Flare Poller [baseline] (3.688 ms) : 0, 3688
Flare Poller [candidate] (3.56 ms) : 0, 3560
IAST [baseline] (25.348 ms) : 0, 25348
IAST [candidate] (25.515 ms) : 0, 25515
section profiling
ProfilingAgent [baseline] (93.489 ms) : 0, 93489
ProfilingAgent [candidate] (93.935 ms) : 0, 93935
crashtracking [baseline] (1.168 ms) : 0, 1168
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (681.768 ms) : 0, 681768
BytebuddyAgent [candidate] (686.072 ms) : 0, 686072
AgentMeter [baseline] (8.928 ms) : 0, 8928
AgentMeter [candidate] (8.933 ms) : 0, 8933
GlobalTracer [baseline] (214.509 ms) : 0, 214509
GlobalTracer [candidate] (216.272 ms) : 0, 216272
AppSec [baseline] (32.163 ms) : 0, 32163
AppSec [candidate] (32.524 ms) : 0, 32524
Debugger [baseline] (65.724 ms) : 0, 65724
Debugger [candidate] (66.155 ms) : 0, 66155
Remote Config [baseline] (560.138 µs) : 0, 560
Remote Config [candidate] (567.052 µs) : 0, 567
Telemetry [baseline] (7.727 ms) : 0, 7727
Telemetry [candidate] (7.751 ms) : 0, 7751
Flare Poller [baseline] (3.467 ms) : 0, 3467
Flare Poller [candidate] (3.494 ms) : 0, 3494
Profiling [baseline] (94.041 ms) : 0, 94041
Profiling [candidate] (94.485 ms) : 0, 94485
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master dd/pre-construct-tagmap-entries
git_commit_date 1774632959 1774636052
git_commit_sha a1239d3 b295f57
release_version 1.61.0-SNAPSHOT~a1239d32d8 1.61.0-SNAPSHOT~b295f57894
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1774638407 1774638407
ci_job_id 1546845104 1546845104
ci_pipeline_id 104831274 104831274
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-v8q9jowj 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-v8q9jowj 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 1 performance improvements and 3 performance regressions! Performance is the same for 15 metrics, 17 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:iast:high_load better
[-145.984µs; -65.467µs] or [-5.791%; -2.597%]
same
[-432.821µs; +23.942µs] or [-5.794%; +0.320%]
unstable
[-99.236op/s; +221.486op/s] or [-7.083%; +15.809%]
2.415ms 7.266ms 1462.125op/s 2.521ms 7.470ms 1401.000op/s
scenario:load:insecure-bank:iast_GLOBAL:high_load worse
[+137.219µs; +254.288µs] or [+5.000%; +9.266%]
unsure
[+79.656µs; +519.950µs] or [+1.013%; +6.613%]
unstable
[-219.075op/s; +67.950op/s] or [-16.737%; +5.191%]
2.940ms 8.162ms 1233.375op/s 2.744ms 7.863ms 1308.938op/s
scenario:load:insecure-bank:profiling:high_load worse
[+52.882µs; +175.415µs] or [+3.225%; +10.697%]
unstable
[+309.349µs; +1068.351µs] or [+6.715%; +23.190%]
unstable
[-459.768op/s; +42.580op/s] or [-20.448%; +1.894%]
1.754ms 5.296ms 2039.906op/s 1.640ms 4.607ms 2248.500op/s
scenario:load:petclinic:tracing:high_load worse
[+0.922ms; +1.740ms] or [+5.307%; +10.019%]
same
[-375.315µs; +1764.563µs] or [-1.309%; +6.154%]
unstable
[-43.958op/s; +11.583op/s] or [-16.762%; +4.417%]
18.702ms 29.368ms 246.062op/s 17.371ms 28.673ms 262.250op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.306 ms) : 18116, 18496
.   : milestone, 18306,
appsec (18.85 ms) : 18653, 19047
.   : milestone, 18850,
code_origins (17.71 ms) : 17533, 17888
.   : milestone, 17710,
iast (17.958 ms) : 17780, 18136
.   : milestone, 17958,
profiling (18.537 ms) : 18354, 18720
.   : milestone, 18537,
tracing (17.791 ms) : 17614, 17969
.   : milestone, 17791,
section candidate
no_agent (19.364 ms) : 19166, 19563
.   : milestone, 19364,
appsec (18.57 ms) : 18383, 18758
.   : milestone, 18570,
code_origins (17.712 ms) : 17537, 17887
.   : milestone, 17712,
iast (18.044 ms) : 17863, 18224
.   : milestone, 18044,
profiling (18.983 ms) : 18798, 19169
.   : milestone, 18983,
tracing (18.966 ms) : 18780, 19151
.   : milestone, 18966,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.306 ms [18.116 ms, 18.496 ms] -
appsec 18.85 ms [18.653 ms, 19.047 ms] 544.162 µs (3.0%)
code_origins 17.71 ms [17.533 ms, 17.888 ms] -595.457 µs (-3.3%)
iast 17.958 ms [17.78 ms, 18.136 ms] -348.065 µs (-1.9%)
profiling 18.537 ms [18.354 ms, 18.72 ms] 230.904 µs (1.3%)
tracing 17.791 ms [17.614 ms, 17.969 ms] -514.459 µs (-2.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 19.364 ms [19.166 ms, 19.563 ms] -
appsec 18.57 ms [18.383 ms, 18.758 ms] -794.264 µs (-4.1%)
code_origins 17.712 ms [17.537 ms, 17.887 ms] -1.653 ms (-8.5%)
iast 18.044 ms [17.863 ms, 18.224 ms] -1.321 ms (-6.8%)
profiling 18.983 ms [18.798 ms, 19.169 ms] -381.013 µs (-2.0%)
tracing 18.966 ms [18.78 ms, 19.151 ms] -398.552 µs (-2.1%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.174 ms) : 1163, 1185
.   : milestone, 1174,
iast (3.267 ms) : 3217, 3318
.   : milestone, 3267,
iast_FULL (5.84 ms) : 5782, 5899
.   : milestone, 5840,
iast_GLOBAL (3.503 ms) : 3447, 3559
.   : milestone, 3503,
profiling (2.008 ms) : 1990, 2025
.   : milestone, 2008,
tracing (1.816 ms) : 1801, 1830
.   : milestone, 1816,
section candidate
no_agent (1.175 ms) : 1164, 1187
.   : milestone, 1175,
iast (3.126 ms) : 3089, 3164
.   : milestone, 3126,
iast_FULL (5.752 ms) : 5693, 5810
.   : milestone, 5752,
iast_GLOBAL (3.721 ms) : 3658, 3785
.   : milestone, 3721,
profiling (2.22 ms) : 2199, 2241
.   : milestone, 2220,
tracing (1.796 ms) : 1781, 1811
.   : milestone, 1796,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.174 ms [1.163 ms, 1.185 ms] -
iast 3.267 ms [3.217 ms, 3.318 ms] 2.094 ms (178.4%)
iast_FULL 5.84 ms [5.782 ms, 5.899 ms] 4.666 ms (397.6%)
iast_GLOBAL 3.503 ms [3.447 ms, 3.559 ms] 2.329 ms (198.5%)
profiling 2.008 ms [1.99 ms, 2.025 ms] 834.097 µs (71.1%)
tracing 1.816 ms [1.801 ms, 1.83 ms] 641.983 µs (54.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.175 ms [1.164 ms, 1.187 ms] -
iast 3.126 ms [3.089 ms, 3.164 ms] 1.951 ms (166.0%)
iast_FULL 5.752 ms [5.693 ms, 5.81 ms] 4.576 ms (389.4%)
iast_GLOBAL 3.721 ms [3.658 ms, 3.785 ms] 2.546 ms (216.6%)
profiling 2.22 ms [2.199 ms, 2.241 ms] 1.045 ms (88.9%)
tracing 1.796 ms [1.781 ms, 1.811 ms] 620.695 µs (52.8%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master dd/pre-construct-tagmap-entries
git_commit_date 1774632959 1774636052
git_commit_sha a1239d3 b295f57
release_version 1.61.0-SNAPSHOT~a1239d32d8 1.61.0-SNAPSHOT~b295f57894
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1774638244 1774638244
ci_job_id 1546845108 1546845108
ci_pipeline_id 104831274 104831274
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-2-2cpw994s 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-2-2cpw994s 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.474 ms) : 1462, 1485
.   : milestone, 1474,
appsec (2.534 ms) : 2478, 2590
.   : milestone, 2534,
iast (2.264 ms) : 2194, 2333
.   : milestone, 2264,
iast_GLOBAL (2.294 ms) : 2225, 2364
.   : milestone, 2294,
profiling (2.114 ms) : 2058, 2170
.   : milestone, 2114,
tracing (2.074 ms) : 2021, 2128
.   : milestone, 2074,
section candidate
no_agent (1.477 ms) : 1465, 1488
.   : milestone, 1477,
appsec (2.53 ms) : 2475, 2586
.   : milestone, 2530,
iast (2.274 ms) : 2205, 2344
.   : milestone, 2274,
iast_GLOBAL (2.298 ms) : 2228, 2368
.   : milestone, 2298,
profiling (2.09 ms) : 2035, 2145
.   : milestone, 2090,
tracing (2.066 ms) : 2012, 2119
.   : milestone, 2066,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.474 ms [1.462 ms, 1.485 ms] -
appsec 2.534 ms [2.478 ms, 2.59 ms] 1.061 ms (72.0%)
iast 2.264 ms [2.194 ms, 2.333 ms] 789.929 µs (53.6%)
iast_GLOBAL 2.294 ms [2.225 ms, 2.364 ms] 820.841 µs (55.7%)
profiling 2.114 ms [2.058 ms, 2.17 ms] 640.233 µs (43.4%)
tracing 2.074 ms [2.021 ms, 2.128 ms] 600.815 µs (40.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.465 ms, 1.488 ms] -
appsec 2.53 ms [2.475 ms, 2.586 ms] 1.054 ms (71.3%)
iast 2.274 ms [2.205 ms, 2.344 ms] 797.566 µs (54.0%)
iast_GLOBAL 2.298 ms [2.228 ms, 2.368 ms] 821.242 µs (55.6%)
profiling 2.09 ms [2.035 ms, 2.145 ms] 613.103 µs (41.5%)
tracing 2.066 ms [2.012 ms, 2.119 ms] 588.915 µs (39.9%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~b295f57894, baseline=1.61.0-SNAPSHOT~a1239d32d8
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.572 s) : 15572000, 15572000
.   : milestone, 15572000,
appsec (15.139 s) : 15139000, 15139000
.   : milestone, 15139000,
iast (18.442 s) : 18442000, 18442000
.   : milestone, 18442000,
iast_GLOBAL (17.86 s) : 17860000, 17860000
.   : milestone, 17860000,
profiling (14.856 s) : 14856000, 14856000
.   : milestone, 14856000,
tracing (14.77 s) : 14770000, 14770000
.   : milestone, 14770000,
section candidate
no_agent (15.503 s) : 15503000, 15503000
.   : milestone, 15503000,
appsec (15.034 s) : 15034000, 15034000
.   : milestone, 15034000,
iast (18.084 s) : 18084000, 18084000
.   : milestone, 18084000,
iast_GLOBAL (18.093 s) : 18093000, 18093000
.   : milestone, 18093000,
profiling (14.998 s) : 14998000, 14998000
.   : milestone, 14998000,
tracing (14.679 s) : 14679000, 14679000
.   : milestone, 14679000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.572 s [15.572 s, 15.572 s] -
appsec 15.139 s [15.139 s, 15.139 s] -433.0 ms (-2.8%)
iast 18.442 s [18.442 s, 18.442 s] 2.87 s (18.4%)
iast_GLOBAL 17.86 s [17.86 s, 17.86 s] 2.288 s (14.7%)
profiling 14.856 s [14.856 s, 14.856 s] -716.0 ms (-4.6%)
tracing 14.77 s [14.77 s, 14.77 s] -802.0 ms (-5.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.503 s [15.503 s, 15.503 s] -
appsec 15.034 s [15.034 s, 15.034 s] -469.0 ms (-3.0%)
iast 18.084 s [18.084 s, 18.084 s] 2.581 s (16.6%)
iast_GLOBAL 18.093 s [18.093 s, 18.093 s] 2.59 s (16.7%)
profiling 14.998 s [14.998 s, 14.998 s] -505.0 ms (-3.3%)
tracing 14.679 s [14.679 s, 14.679 s] -824.0 ms (-5.3%)

if (!ddService.toString().equalsIgnoreCase(spanContext.getServiceName())) {
// service name != DD_SERVICE
unsafeTags.set(DDTags.BASE_SERVICE, ddService);
unsafeTags.set(ddServiceEntry);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if ddService == "", then TagMap.Entry.create returns ddServiceEntry == null, which will lead to an NPE here

Copy link
Copy Markdown
Contributor Author

@dougqh dougqh Mar 27, 2026

Choose a reason for hiding this comment

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

Good catch. I let AI generate this.
I had also made DDSpan ignore setTag / setMetric null.

But I didn't do the same for TagMap, and I don't think that I want to. I'll go back and check the null handling more carefully.

Copy link
Copy Markdown
Contributor Author

@dougqh dougqh Mar 27, 2026

Choose a reason for hiding this comment

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

I think I'm going to just get rid of the ddService member variable altogether. TagMap.Entry caches the result of stringValue, so that will be just as good for the equalsIgnoreCase check.

It still isn't clear to me what the original intention was in the case when ddService is the empty string. If I recall correctly, DDSpan / DDSpanContext treat setting empty string as request to the delete the associated tag.

However, I'm not sure that's the intended semantic here. It is also strange because version does have explicit empty handling.

@dougqh
Copy link
Copy Markdown
Contributor Author

dougqh commented Mar 27, 2026

From the review, I think it is clear that we need more tests for how null & empty are handled.

I'm going to add those before merging this; however, I think I'm going to try to land #10822 first. That PR extensively reworks the tests, and the allocation reduction is bigger.

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

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: performance Performance related changes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants