Skip to content

DSM optimizations - major refactoring to get rid of LinkedHashMap #9151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

kr-igor
Copy link
Contributor

@kr-igor kr-igor commented Jul 10, 2025

This change is aimed to reduce DSM overhead by using a lightweight object instead of linked maps.

Introduced DataStreamsTags which are now used instead of LinkedHashMap.
Updated all integrations and tests.

My tests show ~20% throughput increase with a significant latency decrease without increasing CPU load. (left side is v1.51.1, right side is this branch)
Screenshot 2025-07-18 at 1 30 21 PM
Screenshot 2025-07-18 at 1 31 28 PM

@pr-commenter
Copy link

pr-commenter bot commented Jul 11, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/dsm-optimization-v2
git_commit_date 1752864955 1752865523
git_commit_sha 13efd64 9297499
release_version 1.52.0-SNAPSHOT~13efd646bc 1.52.0-SNAPSHOT~929749978d
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752867459 1752867459
ci_job_id 1037098219 1037098219
ci_pipeline_id 71052368 71052368
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-084ogpz5 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-084ogpz5 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 48 metrics, 11 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1048085
Total [baseline] (10.69 s) : 0, 10690004
Agent [candidate] (1.041 s) : 0, 1041398
Total [candidate] (10.651 s) : 0, 10651337
section appsec
Agent [baseline] (1.219 s) : 0, 1218592
Total [baseline] (10.787 s) : 0, 10787396
Agent [candidate] (1.218 s) : 0, 1218469
Total [candidate] (10.738 s) : 0, 10738320
section iast
Agent [baseline] (1.181 s) : 0, 1181369
Total [baseline] (10.867 s) : 0, 10866954
Agent [candidate] (1.192 s) : 0, 1192040
Total [candidate] (10.939 s) : 0, 10938541
section profiling
Agent [baseline] (1.183 s) : 0, 1183476
Total [baseline] (10.802 s) : 0, 10801814
Agent [candidate] (1.19 s) : 0, 1190148
Total [candidate] (10.893 s) : 0, 10892675
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent appsec 1.219 s 170.506 ms (16.3%)
Agent iast 1.181 s 133.284 ms (12.7%)
Agent profiling 1.183 s 135.39 ms (12.9%)
Total tracing 10.69 s -
Total appsec 10.787 s 97.392 ms (0.9%)
Total iast 10.867 s 176.95 ms (1.7%)
Total profiling 10.802 s 111.81 ms (1.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.041 s -
Agent appsec 1.218 s 177.072 ms (17.0%)
Agent iast 1.192 s 150.642 ms (14.5%)
Agent profiling 1.19 s 148.75 ms (14.3%)
Total tracing 10.651 s -
Total appsec 10.738 s 86.982 ms (0.8%)
Total iast 10.939 s 287.203 ms (2.7%)
Total profiling 10.893 s 241.337 ms (2.3%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.434 ms) : 0, 1434
crashtracking [candidate] (1.426 ms) : 0, 1426
BytebuddyAgent [baseline] (736.57 ms) : 0, 736570
BytebuddyAgent [candidate] (731.492 ms) : 0, 731492
GlobalTracer [baseline] (243.22 ms) : 0, 243220
GlobalTracer [candidate] (242.14 ms) : 0, 242140
AppSec [baseline] (30.701 ms) : 0, 30701
AppSec [candidate] (30.392 ms) : 0, 30392
Debugger [baseline] (6.095 ms) : 0, 6095
Debugger [candidate] (6.011 ms) : 0, 6011
Remote Config [baseline] (656.036 µs) : 0, 656
Remote Config [candidate] (650.548 µs) : 0, 651
Telemetry [baseline] (8.279 ms) : 0, 8279
Telemetry [candidate] (8.199 ms) : 0, 8199
section appsec
crashtracking [baseline] (1.43 ms) : 0, 1430
crashtracking [candidate] (1.428 ms) : 0, 1428
BytebuddyAgent [baseline] (752.445 ms) : 0, 752445
BytebuddyAgent [candidate] (751.732 ms) : 0, 751732
GlobalTracer [baseline] (234.06 ms) : 0, 234060
GlobalTracer [candidate] (235.128 ms) : 0, 235128
AppSec [baseline] (166.946 ms) : 0, 166946
AppSec [candidate] (168.773 ms) : 0, 168773
Debugger [baseline] (7.94 ms) : 0, 7940
Debugger [candidate] (7.875 ms) : 0, 7875
Remote Config [baseline] (616.15 µs) : 0, 616
Remote Config [candidate] (594.11 µs) : 0, 594
Telemetry [baseline] (10.245 ms) : 0, 10245
Telemetry [candidate] (8.084 ms) : 0, 8084
IAST [baseline] (23.627 ms) : 0, 23627
IAST [candidate] (23.563 ms) : 0, 23563
section iast
crashtracking [baseline] (1.441 ms) : 0, 1441
crashtracking [candidate] (1.456 ms) : 0, 1456
BytebuddyAgent [baseline] (853.906 ms) : 0, 853906
BytebuddyAgent [candidate] (861.612 ms) : 0, 861612
GlobalTracer [baseline] (232.044 ms) : 0, 232044
GlobalTracer [candidate] (234.477 ms) : 0, 234477
AppSec [baseline] (26.852 ms) : 0, 26852
AppSec [candidate] (30.005 ms) : 0, 30005
Debugger [baseline] (8.31 ms) : 0, 8310
Debugger [candidate] (6.731 ms) : 0, 6731
Remote Config [baseline] (589.781 µs) : 0, 590
Remote Config [candidate] (611.876 µs) : 0, 612
Telemetry [baseline] (7.972 ms) : 0, 7972
Telemetry [candidate] (8.111 ms) : 0, 8111
IAST [baseline] (29.217 ms) : 0, 29217
IAST [candidate] (27.821 ms) : 0, 27821
section profiling
crashtracking [baseline] (1.405 ms) : 0, 1405
crashtracking [candidate] (1.404 ms) : 0, 1404
BytebuddyAgent [baseline] (758.78 ms) : 0, 758780
BytebuddyAgent [candidate] (760.923 ms) : 0, 760923
GlobalTracer [baseline] (220.432 ms) : 0, 220432
GlobalTracer [candidate] (222.248 ms) : 0, 222248
AppSec [baseline] (30.338 ms) : 0, 30338
AppSec [candidate] (30.598 ms) : 0, 30598
Debugger [baseline] (6.967 ms) : 0, 6967
Debugger [candidate] (6.383 ms) : 0, 6383
Remote Config [baseline] (661.052 µs) : 0, 661
Remote Config [candidate] (681.282 µs) : 0, 681
Telemetry [baseline] (14.06 ms) : 0, 14060
Telemetry [candidate] (13.599 ms) : 0, 13599
ProfilingAgent [baseline] (102.455 ms) : 0, 102455
ProfilingAgent [candidate] (105.617 ms) : 0, 105617
Profiling [baseline] (102.478 ms) : 0, 102478
Profiling [candidate] (105.64 ms) : 0, 105640
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044589
Total [baseline] (8.643 s) : 0, 8643322
Agent [candidate] (1.04 s) : 0, 1040393
Total [candidate] (8.611 s) : 0, 8611486
section iast
Agent [baseline] (1.175 s) : 0, 1174517
Total [baseline] (9.287 s) : 0, 9286888
Agent [candidate] (1.186 s) : 0, 1185909
Total [candidate] (9.318 s) : 0, 9318494
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent iast 1.175 s 129.928 ms (12.4%)
Total tracing 8.643 s -
Total iast 9.287 s 643.567 ms (7.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.04 s -
Agent iast 1.186 s 145.515 ms (14.0%)
Total tracing 8.611 s -
Total iast 9.318 s 707.008 ms (8.2%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.434 ms) : 0, 1434
crashtracking [candidate] (1.422 ms) : 0, 1422
BytebuddyAgent [baseline] (732.937 ms) : 0, 732937
BytebuddyAgent [candidate] (730.619 ms) : 0, 730619
GlobalTracer [baseline] (242.741 ms) : 0, 242741
GlobalTracer [candidate] (241.821 ms) : 0, 241821
AppSec [baseline] (30.745 ms) : 0, 30745
AppSec [candidate] (30.57 ms) : 0, 30570
Debugger [baseline] (6.014 ms) : 0, 6014
Debugger [candidate] (6.006 ms) : 0, 6006
Remote Config [baseline] (669.055 µs) : 0, 669
Remote Config [candidate] (651.193 µs) : 0, 651
Telemetry [baseline] (9.024 ms) : 0, 9024
Telemetry [candidate] (8.236 ms) : 0, 8236
section iast
crashtracking [baseline] (1.424 ms) : 0, 1424
crashtracking [candidate] (1.458 ms) : 0, 1458
BytebuddyAgent [baseline] (848.224 ms) : 0, 848224
BytebuddyAgent [candidate] (857.84 ms) : 0, 857840
GlobalTracer [baseline] (231.523 ms) : 0, 231523
GlobalTracer [candidate] (232.677 ms) : 0, 232677
AppSec [baseline] (26.597 ms) : 0, 26597
AppSec [candidate] (28.42 ms) : 0, 28420
Debugger [baseline] (8.434 ms) : 0, 8434
Debugger [candidate] (5.799 ms) : 0, 5799
Remote Config [baseline] (581.359 µs) : 0, 581
Remote Config [candidate] (589.638 µs) : 0, 590
Telemetry [baseline] (7.926 ms) : 0, 7926
Telemetry [candidate] (7.923 ms) : 0, 7923
IAST [baseline] (28.936 ms) : 0, 28936
IAST [candidate] (30.059 ms) : 0, 30059
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/dsm-optimization-v2
git_commit_date 1752864955 1752865523
git_commit_sha 13efd64 9297499
release_version 1.52.0-SNAPSHOT~13efd646bc 1.52.0-SNAPSHOT~929749978d
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752867135 1752867135
ci_job_id 1037098221 1037098221
ci_pipeline_id 71052368 71052368
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-2kzp1roi 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-2kzp1roi 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 2 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:petclinic:no_agent:high_load worse
[+0.748ms; +1.382ms] or [+2.084%; +3.849%]
unstable
[-12.730op/s; +5.205op/s] or [-9.776%; +3.997%]
36.963ms 126.463op/s 35.898ms 130.225op/s
scenario:load:petclinic:profiling:high_load worse
[+1.080ms; +2.021ms] or [+2.289%; +4.285%]
unstable
[-10.384op/s; +4.084op/s] or [-10.467%; +4.117%]
48.716ms 96.062op/s 47.165ms 99.213op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.363 ms) : 4313, 4413
.   : milestone, 4363,
iast (9.494 ms) : 9329, 9658
.   : milestone, 9494,
iast_FULL (13.923 ms) : 13654, 14191
.   : milestone, 13923,
iast_GLOBAL (10.181 ms) : 9989, 10372
.   : milestone, 10181,
profiling (8.779 ms) : 8632, 8926
.   : milestone, 8779,
tracing (7.493 ms) : 7380, 7607
.   : milestone, 7493,
section candidate
no_agent (4.389 ms) : 4340, 4439
.   : milestone, 4389,
iast (9.323 ms) : 9170, 9475
.   : milestone, 9323,
iast_FULL (14.366 ms) : 14080, 14652
.   : milestone, 14366,
iast_GLOBAL (10.254 ms) : 10070, 10439
.   : milestone, 10254,
profiling (8.744 ms) : 8594, 8895
.   : milestone, 8744,
tracing (7.502 ms) : 7389, 7616
.   : milestone, 7502,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.363 ms [4.313 ms, 4.413 ms] -
iast 9.494 ms [9.329 ms, 9.658 ms] 5.131 ms (117.6%)
iast_FULL 13.923 ms [13.654 ms, 14.191 ms] 9.56 ms (219.1%)
iast_GLOBAL 10.181 ms [9.989 ms, 10.372 ms] 5.817 ms (133.3%)
profiling 8.779 ms [8.632 ms, 8.926 ms] 4.416 ms (101.2%)
tracing 7.493 ms [7.38 ms, 7.607 ms] 3.13 ms (71.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.389 ms [4.34 ms, 4.439 ms] -
iast 9.323 ms [9.17 ms, 9.475 ms] 4.933 ms (112.4%)
iast_FULL 14.366 ms [14.08 ms, 14.652 ms] 9.977 ms (227.3%)
iast_GLOBAL 10.254 ms [10.07 ms, 10.439 ms] 5.865 ms (133.6%)
profiling 8.744 ms [8.594 ms, 8.895 ms] 4.355 ms (99.2%)
tracing 7.502 ms [7.389 ms, 7.616 ms] 3.113 ms (70.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (35.898 ms) : 35613, 36184
.   : milestone, 35898,
appsec (47.49 ms) : 47081, 47898
.   : milestone, 47490,
code_origins (45.431 ms) : 45041, 45821
.   : milestone, 45431,
iast (44.961 ms) : 44571, 45352
.   : milestone, 44961,
profiling (47.165 ms) : 46728, 47602
.   : milestone, 47165,
tracing (45.106 ms) : 44722, 45491
.   : milestone, 45106,
section candidate
no_agent (36.963 ms) : 36660, 37266
.   : milestone, 36963,
appsec (48.684 ms) : 48230, 49138
.   : milestone, 48684,
code_origins (46.166 ms) : 45777, 46555
.   : milestone, 46166,
iast (44.049 ms) : 43661, 44437
.   : milestone, 44049,
profiling (48.716 ms) : 48278, 49154
.   : milestone, 48716,
tracing (43.916 ms) : 43544, 44287
.   : milestone, 43916,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 35.898 ms [35.613 ms, 36.184 ms] -
appsec 47.49 ms [47.081 ms, 47.898 ms] 11.591 ms (32.3%)
code_origins 45.431 ms [45.041 ms, 45.821 ms] 9.533 ms (26.6%)
iast 44.961 ms [44.571 ms, 45.352 ms] 9.063 ms (25.2%)
profiling 47.165 ms [46.728 ms, 47.602 ms] 11.267 ms (31.4%)
tracing 45.106 ms [44.722 ms, 45.491 ms] 9.208 ms (25.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.963 ms [36.66 ms, 37.266 ms] -
appsec 48.684 ms [48.23 ms, 49.138 ms] 11.721 ms (31.7%)
code_origins 46.166 ms [45.777 ms, 46.555 ms] 9.203 ms (24.9%)
iast 44.049 ms [43.661 ms, 44.437 ms] 7.086 ms (19.2%)
profiling 48.716 ms [48.278 ms, 49.154 ms] 11.753 ms (31.8%)
tracing 43.916 ms [43.544 ms, 44.287 ms] 6.953 ms (18.8%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/dsm-optimization-v2
git_commit_date 1752864955 1752865523
git_commit_sha 13efd64 9297499
release_version 1.52.0-SNAPSHOT~13efd646bc 1.52.0-SNAPSHOT~929749978d
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1752867717 1752867717
ci_job_id 1037098223 1037098223
ci_pipeline_id 71052368 71052368
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-1-8z8exj5e 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-1-8z8exj5e 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 11 metrics, 1 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.482 ms) : 1470, 1493
.   : milestone, 1482,
appsec (3.674 ms) : 3457, 3892
.   : milestone, 3674,
iast (2.216 ms) : 2152, 2279
.   : milestone, 2216,
iast_GLOBAL (2.262 ms) : 2198, 2326
.   : milestone, 2262,
profiling (2.07 ms) : 2018, 2122
.   : milestone, 2070,
tracing (2.026 ms) : 1978, 2075
.   : milestone, 2026,
section candidate
no_agent (1.477 ms) : 1466, 1489
.   : milestone, 1477,
appsec (3.676 ms) : 3459, 3893
.   : milestone, 3676,
iast (2.207 ms) : 2144, 2270
.   : milestone, 2207,
iast_GLOBAL (2.256 ms) : 2192, 2319
.   : milestone, 2256,
profiling (2.054 ms) : 2003, 2106
.   : milestone, 2054,
tracing (2.035 ms) : 1985, 2084
.   : milestone, 2035,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.482 ms [1.47 ms, 1.493 ms] -
appsec 3.674 ms [3.457 ms, 3.892 ms] 2.192 ms (147.9%)
iast 2.216 ms [2.152 ms, 2.279 ms] 733.883 µs (49.5%)
iast_GLOBAL 2.262 ms [2.198 ms, 2.326 ms] 779.95 µs (52.6%)
profiling 2.07 ms [2.018 ms, 2.122 ms] 588.222 µs (39.7%)
tracing 2.026 ms [1.978 ms, 2.075 ms] 544.595 µs (36.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.477 ms [1.466 ms, 1.489 ms] -
appsec 3.676 ms [3.459 ms, 3.893 ms] 2.199 ms (148.8%)
iast 2.207 ms [2.144 ms, 2.27 ms] 729.729 µs (49.4%)
iast_GLOBAL 2.256 ms [2.192 ms, 2.319 ms] 778.31 µs (52.7%)
profiling 2.054 ms [2.003 ms, 2.106 ms] 576.902 µs (39.0%)
tracing 2.035 ms [1.985 ms, 2.084 ms] 557.26 µs (37.7%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~929749978d, baseline=1.52.0-SNAPSHOT~13efd646bc
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.973 s) : 14973000, 14973000
.   : milestone, 14973000,
appsec (15.093 s) : 15093000, 15093000
.   : milestone, 15093000,
iast (18.371 s) : 18371000, 18371000
.   : milestone, 18371000,
iast_GLOBAL (17.797 s) : 17797000, 17797000
.   : milestone, 17797000,
profiling (15.243 s) : 15243000, 15243000
.   : milestone, 15243000,
tracing (14.78 s) : 14780000, 14780000
.   : milestone, 14780000,
section candidate
no_agent (15.458 s) : 15458000, 15458000
.   : milestone, 15458000,
appsec (15.018 s) : 15018000, 15018000
.   : milestone, 15018000,
iast (18.483 s) : 18483000, 18483000
.   : milestone, 18483000,
iast_GLOBAL (17.893 s) : 17893000, 17893000
.   : milestone, 17893000,
profiling (16.044 s) : 16044000, 16044000
.   : milestone, 16044000,
tracing (14.949 s) : 14949000, 14949000
.   : milestone, 14949000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.973 s [14.973 s, 14.973 s] -
appsec 15.093 s [15.093 s, 15.093 s] 120.0 ms (0.8%)
iast 18.371 s [18.371 s, 18.371 s] 3.398 s (22.7%)
iast_GLOBAL 17.797 s [17.797 s, 17.797 s] 2.824 s (18.9%)
profiling 15.243 s [15.243 s, 15.243 s] 270.0 ms (1.8%)
tracing 14.78 s [14.78 s, 14.78 s] -193.0 ms (-1.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.458 s [15.458 s, 15.458 s] -
appsec 15.018 s [15.018 s, 15.018 s] -440.0 ms (-2.8%)
iast 18.483 s [18.483 s, 18.483 s] 3.025 s (19.6%)
iast_GLOBAL 17.893 s [17.893 s, 17.893 s] 2.435 s (15.8%)
profiling 16.044 s [16.044 s, 16.044 s] 586.0 ms (3.8%)
tracing 14.949 s [14.949 s, 14.949 s] -509.0 ms (-3.3%)

@pr-commenter
Copy link

pr-commenter bot commented Jul 11, 2025

Kafka / producer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/dsm-optimization-v2
git_commit_date 1752864955 1752865523
git_commit_sha 13efd64 9297499
See matching parameters
Baseline Candidate
ci_job_date 1752866719 1752866719
ci_job_id 1037098231 1037098231
ci_pipeline_id 71052368 71052368
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/producer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaProduceBenchmark.benchProduce same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaProduceBenchmark.benchProduce same

@kr-igor kr-igor marked this pull request as ready for review July 11, 2025 22:53
@kr-igor kr-igor requested review from a team as code owners July 11, 2025 22:53
@kr-igor kr-igor requested a review from smola July 11, 2025 22:53
Copy link
Contributor

github-actions bot commented Jul 11, 2025

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@pr-commenter
Copy link

pr-commenter bot commented Jul 11, 2025

Kafka / consumer-benchmark

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master kr-igor/dsm-optimization-v2
git_commit_date 1752771474 1752786514
git_commit_sha 887ea39 3de3d08
See matching parameters
Baseline Candidate
ci_job_date 1752787576 1752787576
ci_job_id 1035224753 1035224753
ci_pipeline_id 70931395 70931395
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
jdkVersion 11.0.25 11.0.25
jmhVersion 1.36 1.36
jvm /usr/lib/jvm/java-11-openjdk-amd64/bin/java /usr/lib/jvm/java-11-openjdk-amd64/bin/java
jvmArgs -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/go/src/github.com/DataDog/apm-reliability/dd-trace-java/platform/src/consumer-benchmark/build/tmp/jmh -Duser.country=US -Duser.language=en -Duser.variant
vmName OpenJDK 64-Bit Server VM OpenJDK 64-Bit Server VM
vmVersion 11.0.25+9-post-Ubuntu-1ubuntu122.04 11.0.25+9-post-Ubuntu-1ubuntu122.04

Summary

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

See unchanged results
scenario Δ mean throughput
scenario:not-instrumented/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-disabled-benchmarks/KafkaConsumerBenchmark.benchConsume same
scenario:only-tracing-dsm-enabled-benchmarks/KafkaConsumerBenchmark.benchConsume same

result.put(DIRECTION_TAG, DIRECTION_OUT);
result.put(TYPE_TAG, "grpc");
return DataStreamsContext.fromTags(result);
return DataStreamsContext.fromTags(
Copy link
Contributor

@dougqh dougqh Jul 14, 2025

Choose a reason for hiding this comment

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

I would avoid builder idioms in the critical path. That's still extra allocation that we really don't need.


public DataStreamsTags(DataStreamsTagsBuilder builder) {
this.builder = builder;
this.size =
Copy link
Contributor

Choose a reason for hiding this comment

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

This is introducing a capturing lambda. I think a regular loop would probably be better here.

Comment on lines 93 to 102
processor.process(BUS_TAG, this.builder.bus);
count += 1;
}

if (this.builder.direction == Direction.Inbound) {
count += 1;
processor.process(DIRECTION_TAG, DIRECTION_IN);
} else if (this.builder.direction == Direction.Outbound) {
count += 1;
processor.process(DIRECTION_TAG, DIRECTION_OUT);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Just a matter of taste, but probably count++; Would be a better option (here and other similar places)?

Comment on lines 286 to 299
+ ","
+ ", kafkaClusterId='"
+ this.builder.kafkaClusterId
+ ","
+ ", partition='"
+ this.builder.partition
+ ","
+ ", hash="
+ hash
+ ","
+ ", aggregationHash="
+ aggregationHash
+ ","
+ ", size="
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this code will produce String with TWO commas. Is that expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right... AI autosuggest :D

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice :), just FYI IDEA has toString() method generation too,

result.put(TYPE_TAG, "grpc");
return result;
private static final DataStreamsTags createServerPathwaySortedTags() {
return new DataStreamsTagsBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can probably still keep these pretty clean without needing a builder. I've put suggestions throughout...

  • createGrpcInbound() <-- bonus, that's cacheable

DataStreamsContext dsmContext = DataStreamsContext.fromTags(getTags(eventBusName));
DataStreamsTags tags =
new DataStreamsTagsBuilder()
.withDirection(DataStreamsTags.Direction.Outbound)
Copy link
Contributor

@dougqh dougqh Jul 14, 2025

Choose a reason for hiding this comment

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

createBusOutbound(eventBusName)

sortedTags.put(TagsProcessor.TOPIC_TAG, bucket);
sortedTags.put(TagsProcessor.TYPE_TAG, "s3");
DataStreamsTags tags =
new DataStreamsTagsBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

createS3Outbound(bucket, key)

sortedTags.put(TYPE_TAG, "kinesis");
DataStreamsTags tags =
new DataStreamsTagsBuilder()
.withType("kinesis")
Copy link
Contributor

Choose a reason for hiding this comment

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

createKinesisInbound(streamArn)


return sortedTags;
private DataStreamsTags getTags(String snsTopicName) {
return new DataStreamsTagsBuilder()
Copy link
Contributor

Choose a reason for hiding this comment

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

createSnsOutbound(snsTopicName)

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

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

If you're in refactoring mode, can you have a look (made in another PR if it's easier) to complete the context refactoring?

In short, PathwayContext should not be stored in span data model (DDSpanContext).
Instead, it must be stored with Context as DataStreamsContext and AgentSpan.
You may create a second Context entry if the DataStreamsContext holds different kind of data (or have a different lifecycle) than what PathwayContext should hold.

I already done some refactoring (adding DataStreamsContext, creating a dedicated DSM propagator) but it miss the last step of moving away PathwayContext from span.
Would that be something you could have a look at? Would you like us to pair on this task? The end goal would be to decouple Tracing from DSM. So you can save even more resources.

@@ -89,7 +85,9 @@ private String getTraceContextToInject(
// Inject context
datadog.context.Context context = span;
if (traceConfig().isDataStreamsEnabled()) {
DataStreamsContext dsmContext = DataStreamsContext.fromTags(getTags(eventBusName));
DataStreamsTags tags =
DataStreamsTags.createWithBus("bus", DataStreamsTags.Direction.Outbound, eventBusName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why pass "bus" as argument to withBus helper? Is there a case where the value isn't "bus"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the type is always bus, no need to pass it here.

private long completeHash;
private int nonNullSize;

// hash tags
Copy link
Contributor

Choose a reason for hiding this comment

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

These should probably be final
Right now, strictly speaking this probably isn't thread safe

kafkaClusterId != null ? KAFKA_CLUSTER_ID_TAG + ":" + kafkaClusterId : null;
this.partition = partition != null ? PARTITION_TAG + ":" + partition : null;

// hashable tags are 0-4
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, that should unroll and inline nicely

@kr-igor
Copy link
Contributor Author

kr-igor commented Jul 16, 2025

If you're in refactoring mode, can you have a look (made in another PR if it's easier) to complete the context refactoring?

In short, PathwayContext should not be stored in span data model (DDSpanContext). Instead, it must be stored with Context as DataStreamsContext and AgentSpan. You may create a second Context entry if the DataStreamsContext holds different kind of data (or have a different lifecycle) than what PathwayContext should hold.

I already done some refactoring (adding DataStreamsContext, creating a dedicated DSM propagator) but it miss the last step of moving away PathwayContext from span. Would that be something you could have a look at? Would you like us to pair on this task? The end goal would be to decouple Tracing from DSM. So you can save even more resources.

I'm definitely for refactoring the context propagation logic, but I don't want to bundle the changes into a single PR.

@kr-igor kr-igor requested a review from a team as a code owner July 16, 2025 16:25
@kr-igor kr-igor added type: enhancement Enhancements and improvements comp: data streams Data Streams Monitoring labels Jul 16, 2025
Copy link
Contributor

@dougqh dougqh left a comment

Choose a reason for hiding this comment

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

That's a very nice improvement. Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: data streams Data Streams Monitoring type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants