Skip to content

add safe local var hoisting #9034

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

Merged
merged 1 commit into from
Jul 1, 2025
Merged

add safe local var hoisting #9034

merged 1 commit into from
Jul 1, 2025

Conversation

jpbempel
Copy link
Member

@jpbempel jpbempel commented Jun 25, 2025

What Does This Do

Introduce local var hoisting level:
0: no hoisting
1: safe hoisting
2: aggressive hoisting.
for now we are only implementing safe hoisting. Aggressive will be later.
Safe hoisting consists of scanning the bytecode instructions of the methods to find the store and load for local var, scan local variable table to find potential slot or name conflicts.
the safe hoisting is done when there is only one variable per slot without name conflict and for the same type.
hoisting is done by extending the range of the local variable to range of the method and initializing to 0 at the beginning of the method. Long and double variable are not part of the safe hoisting because they are using 2 slots and hoisting them can result in a conflict with
another variable in another range. Also we prevent hoisting for the
second slot for the same reason (forbidden slots)

Motivation

capture local variables for method probe and exception probes

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-3304

@jpbempel jpbempel requested a review from a team as a code owner June 25, 2025 17:15
@jpbempel jpbempel requested a review from smola June 25, 2025 17:15
@jpbempel jpbempel added type: enhancement Enhancements and improvements comp: debugger Dynamic Instrumentation labels Jun 25, 2025
"/Users/jean-philippe.bempel/projects/Sandbox/build/classes/java/main/com/bempel/sandbox/dataflow/TestClass_hoisted.class")) {
fos.write(buffer);
} catch (IOException e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

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

🟠 Code Quality Violation

Avoid printStackTrace(); use a logger call instead. (...read more)

Use a logging framework instead of printStackTrace() when handling exceptions. printStackTrace() can be useful during development for quick debugging, but it is not suitable for production code.

View in Datadog  Leave us feedback  Documentation

@pr-commenter
Copy link

pr-commenter bot commented Jun 25, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/RangeScopeHoisting
git_commit_date 1750926861 1750929028
git_commit_sha ae1f104 884caf7
release_version 1.51.0-SNAPSHOT~ae1f104361 1.51.0-SNAPSHOT~884caf70c4
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1750930872 1750930872
ci_job_id 999641051 999641051
ci_pipeline_id 68828301 68828301
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-ltijhv1y-project-304-concurrent-0-k71r0s1k 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-ltijhv1y-project-304-concurrent-0-k71r0s1k 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 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 45 metrics, 8 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (997.787 ms) : 0, 997787
Total [baseline] (10.73 s) : 0, 10730396
Agent [candidate] (995.771 ms) : 0, 995771
Total [candidate] (10.716 s) : 0, 10716021
section appsec
Agent [baseline] (1.174 s) : 0, 1173543
Total [baseline] (10.784 s) : 0, 10784374
Agent [candidate] (1.174 s) : 0, 1173570
Total [candidate] (10.771 s) : 0, 10770943
section iast
Agent [baseline] (1.132 s) : 0, 1131898
Total [baseline] (10.844 s) : 0, 10843933
Agent [candidate] (1.132 s) : 0, 1132285
Total [candidate] (10.803 s) : 0, 10803172
section profiling
Agent [baseline] (1.251 s) : 0, 1251425
Total [baseline] (10.981 s) : 0, 10981278
Agent [candidate] (1.247 s) : 0, 1246554
Total [candidate] (10.995 s) : 0, 10995287
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 997.787 ms -
Agent appsec 1.174 s 175.756 ms (17.6%)
Agent iast 1.132 s 134.112 ms (13.4%)
Agent profiling 1.251 s 253.638 ms (25.4%)
Total tracing 10.73 s -
Total appsec 10.784 s 53.978 ms (0.5%)
Total iast 10.844 s 113.537 ms (1.1%)
Total profiling 10.981 s 250.882 ms (2.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 995.771 ms -
Agent appsec 1.174 s 177.799 ms (17.9%)
Agent iast 1.132 s 136.514 ms (13.7%)
Agent profiling 1.247 s 250.783 ms (25.2%)
Total tracing 10.716 s -
Total appsec 10.771 s 54.921 ms (0.5%)
Total iast 10.803 s 87.15 ms (0.8%)
Total profiling 10.995 s 279.266 ms (2.6%)
gantt
    title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (688.391 ms) : 0, 688391
BytebuddyAgent [candidate] (687.217 ms) : 0, 687217
GlobalTracer [baseline] (243.099 ms) : 0, 243099
GlobalTracer [candidate] (242.361 ms) : 0, 242361
AppSec [baseline] (30.466 ms) : 0, 30466
AppSec [candidate] (30.501 ms) : 0, 30501
Debugger [baseline] (6.056 ms) : 0, 6056
Debugger [candidate] (6.072 ms) : 0, 6072
Remote Config [baseline] (662.853 µs) : 0, 663
Remote Config [candidate] (669.592 µs) : 0, 670
Telemetry [baseline] (8.3 ms) : 0, 8300
Telemetry [candidate] (8.23 ms) : 0, 8230
section appsec
BytebuddyAgent [baseline] (710.151 ms) : 0, 710151
BytebuddyAgent [candidate] (710.919 ms) : 0, 710919
GlobalTracer [baseline] (235.927 ms) : 0, 235927
GlobalTracer [candidate] (235.728 ms) : 0, 235728
IAST [baseline] (22.049 ms) : 0, 22049
IAST [candidate] (22.012 ms) : 0, 22012
AppSec [baseline] (170.099 ms) : 0, 170099
AppSec [candidate] (169.662 ms) : 0, 169662
Debugger [baseline] (5.806 ms) : 0, 5806
Debugger [candidate] (5.751 ms) : 0, 5751
Remote Config [baseline] (605.227 µs) : 0, 605
Remote Config [candidate] (611.215 µs) : 0, 611
Telemetry [baseline] (8.142 ms) : 0, 8142
Telemetry [candidate] (8.12 ms) : 0, 8120
section iast
BytebuddyAgent [baseline] (807.877 ms) : 0, 807877
BytebuddyAgent [candidate] (808.722 ms) : 0, 808722
GlobalTracer [baseline] (233.609 ms) : 0, 233609
GlobalTracer [candidate] (233.202 ms) : 0, 233202
IAST [baseline] (28.53 ms) : 0, 28530
IAST [candidate] (30.168 ms) : 0, 30168
AppSec [baseline] (26.805 ms) : 0, 26805
AppSec [candidate] (25.184 ms) : 0, 25184
Debugger [baseline] (5.804 ms) : 0, 5804
Debugger [candidate] (5.813 ms) : 0, 5813
Remote Config [baseline] (578.669 µs) : 0, 579
Remote Config [candidate] (578.133 µs) : 0, 578
Telemetry [baseline] (7.938 ms) : 0, 7938
Telemetry [candidate] (7.928 ms) : 0, 7928
section profiling
BytebuddyAgent [baseline] (683.326 ms) : 0, 683326
BytebuddyAgent [candidate] (679.788 ms) : 0, 679788
GlobalTracer [baseline] (362.62 ms) : 0, 362620
GlobalTracer [candidate] (361.637 ms) : 0, 361637
AppSec [baseline] (33.792 ms) : 0, 33792
AppSec [candidate] (33.74 ms) : 0, 33740
Debugger [baseline] (9.824 ms) : 0, 9824
Debugger [candidate] (9.263 ms) : 0, 9263
Remote Config [baseline] (662.183 µs) : 0, 662
Remote Config [candidate] (664.573 µs) : 0, 665
Telemetry [baseline] (8.784 ms) : 0, 8784
Telemetry [candidate] (9.472 ms) : 0, 9472
ProfilingAgent [baseline] (103.525 ms) : 0, 103525
ProfilingAgent [candidate] (103.513 ms) : 0, 103513
Profiling [baseline] (103.551 ms) : 0, 103551
Profiling [candidate] (103.537 ms) : 0, 103537
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (996.23 ms) : 0, 996230
Total [baseline] (8.529 s) : 0, 8528867
Agent [candidate] (996.186 ms) : 0, 996186
Total [candidate] (8.558 s) : 0, 8557850
section iast
Agent [baseline] (1.13 s) : 0, 1130167
Total [baseline] (9.27 s) : 0, 9270361
Agent [candidate] (1.134 s) : 0, 1133926
Total [candidate] (9.246 s) : 0, 9245629
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 996.23 ms -
Agent iast 1.13 s 133.937 ms (13.4%)
Total tracing 8.529 s -
Total iast 9.27 s 741.494 ms (8.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 996.186 ms -
Agent iast 1.134 s 137.74 ms (13.8%)
Total tracing 8.558 s -
Total iast 9.246 s 687.779 ms (8.0%)
gantt
    title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.497 ms) : 0, 687497
BytebuddyAgent [candidate] (687.108 ms) : 0, 687108
GlobalTracer [baseline] (242.633 ms) : 0, 242633
GlobalTracer [candidate] (242.728 ms) : 0, 242728
AppSec [baseline] (30.358 ms) : 0, 30358
AppSec [candidate] (30.482 ms) : 0, 30482
Debugger [baseline] (6.034 ms) : 0, 6034
Debugger [candidate] (6.097 ms) : 0, 6097
Remote Config [baseline] (670.163 µs) : 0, 670
Remote Config [candidate] (681.076 µs) : 0, 681
Telemetry [baseline] (8.235 ms) : 0, 8235
Telemetry [candidate] (8.225 ms) : 0, 8225
section iast
BytebuddyAgent [baseline] (806.562 ms) : 0, 806562
BytebuddyAgent [candidate] (809.009 ms) : 0, 809009
GlobalTracer [baseline] (232.585 ms) : 0, 232585
GlobalTracer [candidate] (234.138 ms) : 0, 234138
IAST [baseline] (27.139 ms) : 0, 27139
IAST [candidate] (27.812 ms) : 0, 27812
AppSec [baseline] (28.745 ms) : 0, 28745
AppSec [candidate] (27.78 ms) : 0, 27780
Debugger [baseline] (5.81 ms) : 0, 5810
Debugger [candidate] (5.801 ms) : 0, 5801
Remote Config [baseline] (577.025 µs) : 0, 577
Remote Config [candidate] (588.493 µs) : 0, 588
Telemetry [baseline] (8.024 ms) : 0, 8024
Telemetry [candidate] (8.032 ms) : 0, 8032
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/RangeScopeHoisting
git_commit_date 1750926861 1750929028
git_commit_sha ae1f104 884caf7
release_version 1.51.0-SNAPSHOT~ae1f104361 1.51.0-SNAPSHOT~884caf70c4
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1750930548 1750930548
ci_job_id 999641052 999641052
ci_pipeline_id 68828301 68828301
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-iun2vzqu-project-304-concurrent-0-t1h1htgk 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-iun2vzqu-project-304-concurrent-0-t1h1htgk 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 3 performance regressions! Performance is the same for 9 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:insecure-bank:tracing:high_load worse
[+209.906µs; +452.620µs] or [+2.749%; +5.927%]
unstable
[-101.026op/s; +50.589op/s] or [-16.656%; +8.340%]
7.968ms 581.344op/s 7.637ms 606.562op/s
scenario:load:petclinic:profiling:high_load worse
[+1.442ms; +2.416ms] or [+2.991%; +5.011%]
unstable
[-11.751op/s; +1.895op/s] or [-11.961%; +1.929%]
50.148ms 93.312op/s 48.218ms 98.241op/s
scenario:load:petclinic:tracing:high_load worse
[+1.702ms; +2.506ms] or [+3.838%; +5.653%]
unstable
[-12.352op/s; +2.777op/s] or [-11.703%; +2.631%]
46.435ms 100.763op/s 44.331ms 105.550op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361
    dateFormat X
    axisFormat %s
section baseline
no_agent (38.381 ms) : 38067, 38696
.   : milestone, 38381,
appsec (49.15 ms) : 48714, 49586
.   : milestone, 49150,
code_origins (45.138 ms) : 44769, 45506
.   : milestone, 45138,
iast (44.083 ms) : 43687, 44478
.   : milestone, 44083,
profiling (48.218 ms) : 47780, 48657
.   : milestone, 48218,
tracing (44.331 ms) : 43973, 44690
.   : milestone, 44331,
section candidate
no_agent (37.342 ms) : 37043, 37641
.   : milestone, 37342,
appsec (47.833 ms) : 47409, 48257
.   : milestone, 47833,
code_origins (44.941 ms) : 44569, 45312
.   : milestone, 44941,
iast (44.15 ms) : 43758, 44542
.   : milestone, 44150,
profiling (50.148 ms) : 49681, 50614
.   : milestone, 50148,
tracing (46.435 ms) : 46047, 46824
.   : milestone, 46435,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 38.381 ms [38.067 ms, 38.696 ms] -
appsec 49.15 ms [48.714 ms, 49.586 ms] 10.769 ms (28.1%)
code_origins 45.138 ms [44.769 ms, 45.506 ms] 6.756 ms (17.6%)
iast 44.083 ms [43.687 ms, 44.478 ms] 5.701 ms (14.9%)
profiling 48.218 ms [47.78 ms, 48.657 ms] 9.837 ms (25.6%)
tracing 44.331 ms [43.973 ms, 44.69 ms] 5.95 ms (15.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.342 ms [37.043 ms, 37.641 ms] -
appsec 47.833 ms [47.409 ms, 48.257 ms] 10.491 ms (28.1%)
code_origins 44.941 ms [44.569 ms, 45.312 ms] 7.599 ms (20.3%)
iast 44.15 ms [43.758 ms, 44.542 ms] 6.808 ms (18.2%)
profiling 50.148 ms [49.681 ms, 50.614 ms] 12.806 ms (34.3%)
tracing 46.435 ms [46.047 ms, 46.824 ms] 9.093 ms (24.4%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.359 ms) : 4309, 4409
.   : milestone, 4359,
iast (8.767 ms) : 8625, 8909
.   : milestone, 8767,
iast_FULL (14.042 ms) : 13762, 14321
.   : milestone, 14042,
iast_GLOBAL (9.96 ms) : 9785, 10134
.   : milestone, 9960,
profiling (9.068 ms) : 8908, 9228
.   : milestone, 9068,
tracing (7.637 ms) : 7529, 7745
.   : milestone, 7637,
section candidate
no_agent (4.346 ms) : 4297, 4394
.   : milestone, 4346,
iast (8.8 ms) : 8656, 8943
.   : milestone, 8800,
iast_FULL (13.952 ms) : 13676, 14228
.   : milestone, 13952,
iast_GLOBAL (10.139 ms) : 9962, 10317
.   : milestone, 10139,
profiling (9.069 ms) : 8927, 9211
.   : milestone, 9069,
tracing (7.968 ms) : 7851, 8086
.   : milestone, 7968,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.359 ms [4.309 ms, 4.409 ms] -
iast 8.767 ms [8.625 ms, 8.909 ms] 4.408 ms (101.1%)
iast_FULL 14.042 ms [13.762 ms, 14.321 ms] 9.683 ms (222.1%)
iast_GLOBAL 9.96 ms [9.785 ms, 10.134 ms] 5.601 ms (128.5%)
profiling 9.068 ms [8.908 ms, 9.228 ms] 4.709 ms (108.0%)
tracing 7.637 ms [7.529 ms, 7.745 ms] 3.278 ms (75.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.346 ms [4.297 ms, 4.394 ms] -
iast 8.8 ms [8.656 ms, 8.943 ms] 4.454 ms (102.5%)
iast_FULL 13.952 ms [13.676 ms, 14.228 ms] 9.606 ms (221.0%)
iast_GLOBAL 10.139 ms [9.962 ms, 10.317 ms] 5.794 ms (133.3%)
profiling 9.069 ms [8.927 ms, 9.211 ms] 4.723 ms (108.7%)
tracing 7.968 ms [7.851 ms, 8.086 ms] 3.622 ms (83.4%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/RangeScopeHoisting
git_commit_date 1750926861 1750929028
git_commit_sha ae1f104 884caf7
release_version 1.51.0-SNAPSHOT~ae1f104361 1.51.0-SNAPSHOT~884caf70c4
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1750931100 1750931100
ci_job_id 999641053 999641053
ci_pipeline_id 68828301 68828301
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-cpksuxk1-project-304-concurrent-0-aoix9c6k 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-cpksuxk1-project-304-concurrent-0-aoix9c6k 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 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.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.475 ms) : 1464, 1487
.   : milestone, 1475,
appsec (2.392 ms) : 2344, 2440
.   : milestone, 2392,
iast (2.177 ms) : 2116, 2238
.   : milestone, 2177,
iast_GLOBAL (2.229 ms) : 2167, 2290
.   : milestone, 2229,
profiling (2.032 ms) : 1982, 2081
.   : milestone, 2032,
tracing (1.994 ms) : 1946, 2041
.   : milestone, 1994,
section candidate
no_agent (1.473 ms) : 1462, 1485
.   : milestone, 1473,
appsec (2.386 ms) : 2337, 2434
.   : milestone, 2386,
iast (2.18 ms) : 2118, 2241
.   : milestone, 2180,
iast_GLOBAL (2.213 ms) : 2152, 2274
.   : milestone, 2213,
profiling (2.044 ms) : 1994, 2094
.   : milestone, 2044,
tracing (1.995 ms) : 1948, 2042
.   : milestone, 1995,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.464 ms, 1.487 ms] -
appsec 2.392 ms [2.344 ms, 2.44 ms] 916.579 µs (62.1%)
iast 2.177 ms [2.116 ms, 2.238 ms] 701.895 µs (47.6%)
iast_GLOBAL 2.229 ms [2.167 ms, 2.29 ms] 753.187 µs (51.1%)
profiling 2.032 ms [1.982 ms, 2.081 ms] 556.39 µs (37.7%)
tracing 1.994 ms [1.946 ms, 2.041 ms] 518.247 µs (35.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.473 ms [1.462 ms, 1.485 ms] -
appsec 2.386 ms [2.337 ms, 2.434 ms] 912.555 µs (61.9%)
iast 2.18 ms [2.118 ms, 2.241 ms] 706.549 µs (48.0%)
iast_GLOBAL 2.213 ms [2.152 ms, 2.274 ms] 739.708 µs (50.2%)
profiling 2.044 ms [1.994 ms, 2.094 ms] 570.849 µs (38.8%)
tracing 1.995 ms [1.948 ms, 2.042 ms] 521.797 µs (35.4%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~884caf70c4, baseline=1.51.0-SNAPSHOT~ae1f104361
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.032 s) : 15032000, 15032000
.   : milestone, 15032000,
appsec (14.743 s) : 14743000, 14743000
.   : milestone, 14743000,
iast (18.514 s) : 18514000, 18514000
.   : milestone, 18514000,
iast_GLOBAL (18.092 s) : 18092000, 18092000
.   : milestone, 18092000,
profiling (15.36 s) : 15360000, 15360000
.   : milestone, 15360000,
tracing (14.731 s) : 14731000, 14731000
.   : milestone, 14731000,
section candidate
no_agent (15.407 s) : 15407000, 15407000
.   : milestone, 15407000,
appsec (14.965 s) : 14965000, 14965000
.   : milestone, 14965000,
iast (18.399 s) : 18399000, 18399000
.   : milestone, 18399000,
iast_GLOBAL (18.291 s) : 18291000, 18291000
.   : milestone, 18291000,
profiling (15.28 s) : 15280000, 15280000
.   : milestone, 15280000,
tracing (14.804 s) : 14804000, 14804000
.   : milestone, 14804000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.032 s [15.032 s, 15.032 s] -
appsec 14.743 s [14.743 s, 14.743 s] -289.0 ms (-1.9%)
iast 18.514 s [18.514 s, 18.514 s] 3.482 s (23.2%)
iast_GLOBAL 18.092 s [18.092 s, 18.092 s] 3.06 s (20.4%)
profiling 15.36 s [15.36 s, 15.36 s] 328.0 ms (2.2%)
tracing 14.731 s [14.731 s, 14.731 s] -301.0 ms (-2.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.407 s [15.407 s, 15.407 s] -
appsec 14.965 s [14.965 s, 14.965 s] -442.0 ms (-2.9%)
iast 18.399 s [18.399 s, 18.399 s] 2.992 s (19.4%)
iast_GLOBAL 18.291 s [18.291 s, 18.291 s] 2.884 s (18.7%)
profiling 15.28 s [15.28 s, 15.28 s] -127.0 ms (-0.8%)
tracing 14.804 s [14.804 s, 14.804 s] -603.0 ms (-3.9%)

@jpbempel jpbempel force-pushed the jpbempel/RangeScopeHoisting branch from 33b430f to e4fc37a Compare June 26, 2025 07:17
@pr-commenter
Copy link

pr-commenter bot commented Jun 26, 2025

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1750929716 1750930086
end_time 2025-06-26T09:23:17 2025-06-26T09:29:27
git_branch master jpbempel/RangeScopeHoisting
git_commit_sha ae1f104 884caf7
start_time 2025-06-26T09:21:57 2025-06-26T09:28:07
See matching parameters
Baseline Candidate
ci_job_id 999641058 999641058
ci_pipeline_id 68828301 68828301
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1750929028 1750929028

Summary

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

scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:loop worse
[+475.765µs; +562.256µs] or [+4.758%; +5.623%]
worse
[+487.731µs; +592.629µs] or [+4.803%; +5.836%]
worse
[+449.527µs; +581.146µs] or [+4.379%; +5.661%]
worse
[+390.688µs; +725.427µs] or [+3.707%; +6.883%]
worse
[-5.541op/s; -3.448op/s] or [-5.708%; -3.552%]
See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-35.729µs; +26.638µs] or [-12.572%; +9.373%]
unstable
[-50.456µs; +37.538µs] or [-15.390%; +11.449%]
unstable
[-61.568µs; +50.764µs] or [-17.933%; +14.786%]
unstable
[-94.233µs; +142.504µs] or [-10.144%; +15.340%]
same
scenario:basic same same same unstable
[-196.923µs; -11.508µs] or [-23.062%; -1.348%]
unstable
[-89.343op/s; +205.487op/s] or [-3.752%; +8.630%]
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (327.859 µs) : 280, 376
.   : milestone, 328,
basic (322.628 µs) : 311, 334
.   : milestone, 323,
loop (10.155 ms) : 10122, 10187
.   : milestone, 10155,
section candidate
noprobe (321.399 µs) : 287, 356
.   : milestone, 321,
basic (311.982 µs) : 303, 321
.   : milestone, 312,
loop (10.695 ms) : 10634, 10756
.   : milestone, 10695,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 327.859 µs [279.986 µs, 375.732 µs]
basic 322.628 µs [311.388 µs, 333.869 µs]
loop 10.155 ms [10.122 ms, 10.187 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 321.399 µs [286.519 µs, 356.28 µs]
basic 311.982 µs [302.524 µs, 321.44 µs]
loop 10.695 ms [10.634 ms, 10.756 ms]

Introduce local var hoisting level:
 0: no hoisting
 1: safe hoisting
 2: aggressive hoisting.
for now we are only implementing safe hoisting. Aggressive will be
later.
Safe hoisting consists of scanning the bytecode instructions of the
methods to find the store and load for local var, scan local variable
table to find potential slot or name conflicts.
the safe hoisting is done when there is only one variable per slot
without name conflict and for the same type.
hoisting is done by extending the range of the local variable to range
of the method and initializing to 0 at the beginning of the method.
Long and double variable are not part of the safe hoisting because
they are using 2 slots and hoisting them can result in a conflict with
 another variable in another range. Also we prevent hoisting for the
second slot for the same reason (forbidden slots)
@jpbempel jpbempel force-pushed the jpbempel/RangeScopeHoisting branch from e4fc37a to 884caf7 Compare June 26, 2025 09:10
LabelNode methodEnterLabel,
LabelNode methodEndLabel,
Collection<LocalVariableNode> hoisted) {
throw new RuntimeException("Aggressive hoisting not implemented yet.");
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe UnsupportedOperationException might be more semantically meaningful? maybe it doesn't matter.

Copy link
Member

@smola smola left a comment

Choose a reason for hiding this comment

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

Reviewed the config changes.

@jpbempel jpbempel merged commit 84c3bbd into master Jul 1, 2025
515 checks passed
@jpbempel jpbempel deleted the jpbempel/RangeScopeHoisting branch July 1, 2025 09:33
@github-actions github-actions bot added this to the 1.51.0 milestone Jul 1, 2025
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Jul 10, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
|
[com.google.errorprone:error_prone_annotations](https://errorprone.info)
([source](https://github.com/google/error-prone)) | dependencies |
misk/gradle/libs.versions.toml | gradle | minor | `2.39.0` -> `2.40.0` |
|
[org.apache.commons:commons-lang3](https://commons.apache.org/proper/commons-lang/)
([source](https://gitbox.apache.org/repos/asf/commons-lang.git)) |
dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`3.17.0` -> `3.18.0` |
|
[org.jetbrains.kotlinx.binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator)
| plugin | misk/gradle/libs.versions.toml | gradle | patch | `0.18.0` ->
`0.18.1` |
| [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`1.50.1` -> `1.51.0` |
| [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
| [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
|
[software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava)
| dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
| [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
| [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
| [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |
| [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) |
dependencies | misk/gradle/libs.versions.toml | gradle | patch |
`2.31.77` -> `2.31.78` |

---

### Release Notes

<details>
<summary>google/error-prone
(com.google.errorprone:error_prone_annotations)</summary>

###
[`v2.40.0`](https://github.com/google/error-prone/releases/tag/v2.40.0):
Error Prone 2.40.0

Changes:

- Bug fixes and improvements
- Releases (including snapshots) have migrated from [OSSRH to the
Central Publisher
Portal](https://central.sonatype.org/pages/ossrh-eol/#process-to-migrate)

Full changelog:
google/error-prone@v2.39.0...v2.40.0

</details>

<details>
<summary>Kotlin/binary-compatibility-validator
(org.jetbrains.kotlinx.binary-compatibility-validator)</summary>

###
[`v0.18.1`](https://github.com/Kotlin/binary-compatibility-validator/releases/tag/0.18.1)

[Compare
Source](Kotlin/binary-compatibility-validator@0.18.0...0.18.1)

#### What's Changed

- Fixed a bug preventing use of cross-compilation support during KLIB
dump validation
\[[#&#8203;304](https://github.com/Kotlin/binary-compatibility-validator/issues/304)]\[[#&#8203;306](https://github.com/Kotlin/binary-compatibility-validator/issues/306)]

</details>

<details>
<summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary>

###
[`v1.51.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.51.0):
1.51.0

### Components

#### Application Security Management (IAST)

- 🐛 Fix verify error when ctor params are used after a call site
([#&#8203;9083](DataDog/dd-trace-java#9083) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- 🐛 Limit the maximum size of the location path in IAST
vulnerabilities
([#&#8203;9028](DataDog/dd-trace-java#9028) -
[@&#8203;jandro996](https://github.com/jandro996))
- 🐛 Fix IAST gRPC handler with null superclass
([#&#8203;8984](DataDog/dd-trace-java#8984) -
[@&#8203;smola](https://github.com/smola))
- ✨ Optimize IAST Vulnerability Detection
([#&#8203;8885](DataDog/dd-trace-java#8885) -
[@&#8203;jandro996](https://github.com/jandro996))

#### Application Security Management (WAF)

- ✨ Upgrade libddwaf-java to 15.0.0
([#&#8203;9022](DataDog/dd-trace-java#9022) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))
- ✨ Extract RestEasy json body response schemas
([#&#8203;9015](DataDog/dd-trace-java#9015) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Extract Jersey json body response schemas
([#&#8203;9014](DataDog/dd-trace-java#9014) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Extract Ratpack json body response schemas
([#&#8203;9013](DataDog/dd-trace-java#9013) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- ✨ Enable API Security by default and make it lazy loading
([#&#8203;9009](DataDog/dd-trace-java#9009) -
[@&#8203;smola](https://github.com/smola))
- ✨ Extract Vert.x json body response schemas
([#&#8203;9001](DataDog/dd-trace-java#9001) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- ✨ Extract Play json body response schemas
([#&#8203;8995](DataDog/dd-trace-java#8995) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- 🐛 Fix Jackson nodes introspection for request/response schema
extraction
([#&#8203;8980](DataDog/dd-trace-java#8980) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- ✨ Extract Spring json body response schemas
([#&#8203;8938](DataDog/dd-trace-java#8938) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))
- ✨ Default obfuscation regexp update
([#&#8203;8937](DataDog/dd-trace-java#8937) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))

#### Build & Tooling

- ✨ Cancel GitLab running pipeline on new PR push
([#&#8203;9023](DataDog/dd-trace-java#9023) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))
- ✨ Migrate publishing to Maven Central Portal
([#&#8203;8807](DataDog/dd-trace-java#8807) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))

#### Continuous Integration Visibility

- 🐛 Fix Test Optimization to work with JDK 24
([#&#8203;9114](DataDog/dd-trace-java#9114) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- ✨ Add repo root as safe directory on git client creation
([#&#8203;9033](DataDog/dd-trace-java#9033) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Add PR number tag and improve PR information building
([#&#8203;8990](DataDog/dd-trace-java#8990) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Update impacted tests logic
([#&#8203;8923](DataDog/dd-trace-java#8923) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))

#### Data Streams Monitoring

- 🧹 Clean up DSM context injection
([#&#8203;8776](DataDog/dd-trace-java#8776) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Database Monitoring

- 🐛 Set trace\_injected in try block
([#&#8203;9025](DataDog/dd-trace-java#9025) -
[@&#8203;natashadada](https://github.com/natashadada))

#### Dynamic Instrumentation

- 🐛 Add source file tracking enable option
([#&#8203;9115](DataDog/dd-trace-java#9115) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Add java.util.Date support
([#&#8203;9111](DataDog/dd-trace-java#9111) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Update file probe format
([#&#8203;9047](DataDog/dd-trace-java#9047) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ add safe local var hoisting
([#&#8203;9034](DataDog/dd-trace-java#9034) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🧹 Add new config for debugger upload interval
([#&#8203;8959](DataDog/dd-trace-java#8959) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- ✨ Enable Code Origin with Dynamic instrumentation
([#&#8203;8940](DataDog/dd-trace-java#8940) -
[@&#8203;jpbempel](https://github.com/jpbempel))

#### ML Observability (LLMObs)

- 💡 LLM Observability SDK
([#&#8203;8781](DataDog/dd-trace-java#8781) -
[@&#8203;gary-huang](https://github.com/gary-huang),
[@&#8203;nayeem-kamal](https://github.com/nayeem-kamal))

#### Metrics

- 🐛 Ensure client stat reporter is started when the agent is not
available at bootstrap
([#&#8203;9082](DataDog/dd-trace-java#9082) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Create metric: appsec.waf.config\_errors
([#&#8203;8394](DataDog/dd-trace-java#8394) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))

#### Platform components

- ✨ Introduce environment component
([#&#8203;9071](DataDog/dd-trace-java#9071) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Profiling

- 🐛 Remove annoying warning for smap event parsing
([#&#8203;9119](DataDog/dd-trace-java#9119) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- 🐛 Fix ByteCountingInputStream when reading past EOF
([#&#8203;8988](DataDog/dd-trace-java#8988) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))

#### Realtime User Monitoring

- ✨ Add RUM SDK injection for servlet based web servers
([#&#8203;9110](DataDog/dd-trace-java#9110) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer)
[@&#8203;amarziali](https://github.com/amarziali))

#### Telemetry

- ✨ Update the config origin metric to match what it's mapping
([#&#8203;9045](DataDog/dd-trace-java#9045) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))

#### Testing

- ✨ Add testing for latest stable version (JDK 24)
([#&#8203;8875](DataDog/dd-trace-java#8875) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))

#### Trace context propagation

- 🐛 Fix bug with dropping baggage when
`TracePropagationBehaviorExtract=IGNORE`
([#&#8203;9037](DataDog/dd-trace-java#9037) -
[@&#8203;mhlidd](https://github.com/mhlidd))
- 🐛 Fix ArrayIndexOutOfBoundsException in PercentEscaper
([#&#8203;9032](DataDog/dd-trace-java#9032) -
[@&#8203;mhlidd](https://github.com/mhlidd))

#### Tracer core

- 🐛 Fix `Error` handling for trace interceptors
([#&#8203;9097](DataDog/dd-trace-java#9097) -
[@&#8203;AlexeyKuznetsov-DD](https://github.com/AlexeyKuznetsov-DD))
- 💡 Add wildcard feature for `DD_TRACE_HEADER_TAGS` and enabling
for Http Response headers
([#&#8203;9067](DataDog/dd-trace-java#9067) -
[@&#8203;mhlidd](https://github.com/mhlidd))

#### Tracer public API

- 💡 Add LLM Observability SDK
([#&#8203;8781](DataDog/dd-trace-java#8781) -
[@&#8203;gary-huang](https://github.com/gary-huang))

### Instrumentations

#### Akka instrumentation

- 🐛 Fix NPE in akka-http and pekko-http integrations
([#&#8203;9019](DataDog/dd-trace-java#9019) -
[@&#8203;mcculls](https://github.com/mcculls))

#### Eclipse Vert.x instrumentation

- ✨ Extract Vert.x json body response schemas
([#&#8203;9001](DataDog/dd-trace-java#9001) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))
- ✨ Write http.route tag as soon as possible in vert.x
([#&#8203;8952](DataDog/dd-trace-java#8952) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))

#### JAX-WS instrumentation

- 💡⚠️ Enable jax-ws integration by default
([#&#8203;9030](DataDog/dd-trace-java#9030) -
[@&#8203;bm1549](https://github.com/bm1549))
- ✨ Extract Jersey json body response schemas
([#&#8203;9014](DataDog/dd-trace-java#9014) -
[@&#8203;jandro996](https://github.com/jandro996))

#### Mule instrumentation

- 🐛 Propagate grizzly http span in filters if nothing is active
([#&#8203;9016](DataDog/dd-trace-java#9016) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Play Framework instrumentation

- ✨ Extract Play json body response schemas
([#&#8203;8995](DataDog/dd-trace-java#8995) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))

#### Ratpack instrumentation

- ✨ Extract Ratpack json body response schemas
([#&#8203;9013](DataDog/dd-trace-java#9013) -
[@&#8203;manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez))

#### Spring instrumentation

- ✨ Extract Spring json body response schemas
([#&#8203;8938](DataDog/dd-trace-java#8938) -
[@&#8203;sezen-datadog](https://github.com/sezen-datadog))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: 649b690d4c9d7dcb572c457f0802b42b8e3e682e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: debugger Dynamic Instrumentation type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants