Skip to content
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

Fix var hoisting issue when no previous store #8122

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

jpbempel
Copy link
Member

@jpbempel jpbempel commented Dec 20, 2024

What Does This Do

In some cases the range of a local var may not have previous init in the immediate neighborhood because of basic block arrangement. Limit the rewirite of previous instruction for store only and looking
back only 10 instructions

Motivation

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-3273

@jpbempel jpbempel requested a review from a team as a code owner December 20, 2024 14:08
@jpbempel jpbempel requested review from evanchooly and removed request for a team December 20, 2024 14:08
Copy link
Contributor

github-actions bot commented Dec 20, 2024

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.

@jpbempel jpbempel added comp: debugger Dynamic Instrumentation type: bug labels Dec 20, 2024
@pr-commenter
Copy link

pr-commenter bot commented Dec 20, 2024

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1735637848 1735638227
end_time 2024-12-31T09:38:44 2024-12-31T09:45:03
git_branch master jpbempel/fix-var-hoisting-rewriting
git_commit_sha 0dc9c08 a65e6c0
start_time 2024-12-31T09:37:29 2024-12-31T09:43:48
See matching parameters
Baseline Candidate
ci_job_id 751400548 751400548
ci_pipeline_id 51934300 51934300
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1735637173 1735637173

Summary

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

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
[-18.522µs; +26.577µs] or [-7.005%; +10.052%]
unstable
[-30.582µs; +40.086µs] or [-10.048%; +13.170%]
unstable
[-41.297µs; +54.051µs] or [-12.992%; +17.004%]
unstable
[-113.319µs; +86.092µs] or [-18.858%; +14.327%]
same
scenario:basic same same same unstable
[-82.154µs; +11.058µs] or [-14.862%; +2.000%]
unstable
[-160.124op/s; +160.124op/s] or [-6.245%; +6.245%]
scenario:loop unsure
[-163.171µs; -90.132µs] or [-1.582%; -0.874%]
unsure
[-156.552µs; -60.265µs] or [-1.495%; -0.576%]
unsure
[-167.259µs; -42.051µs] or [-1.585%; -0.399%]
unsure
[-490.601µs; -15.880µs] or [-4.455%; -0.144%]
same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (304.372 µs) : 275, 334
.   : milestone, 304,
basic (304.574 µs) : 296, 313
.   : milestone, 305,
loop (10.471 ms) : 10422, 10519
.   : milestone, 10471,
section candidate
noprobe (309.124 µs) : 272, 346
.   : milestone, 309,
basic (302.058 µs) : 291, 313
.   : milestone, 302,
loop (10.362 ms) : 10322, 10403
.   : milestone, 10362,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 304.372 µs [274.503 µs, 334.242 µs]
basic 304.574 µs [295.98 µs, 313.169 µs]
loop 10.471 ms [10.422 ms, 10.519 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 309.124 µs [272.001 µs, 346.247 µs]
basic 302.058 µs [291.239 µs, 312.877 µs]
loop 10.362 ms [10.322 ms, 10.403 ms]

@pr-commenter
Copy link

pr-commenter bot commented Dec 20, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-var-hoisting-rewriting
git_commit_date 1735568221 1735637173
git_commit_sha 0dc9c08 a65e6c0
release_version 1.45.0-SNAPSHOT~0dc9c087f0 1.45.0-SNAPSHOT~a65e6c0cf5
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1735639484 1735639484
ci_job_id 751400542 751400542
ci_pipeline_id 51934300 51934300
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055233
Total [baseline] (10.433 s) : 0, 10432705
Agent [candidate] (1.056 s) : 0, 1055880
Total [candidate] (10.495 s) : 0, 10494565
section appsec
Agent [baseline] (1.193 s) : 0, 1192626
Total [baseline] (10.782 s) : 0, 10782215
Agent [candidate] (1.188 s) : 0, 1188038
Total [candidate] (10.706 s) : 0, 10706233
section iast
Agent [baseline] (1.178 s) : 0, 1177980
Total [baseline] (11.018 s) : 0, 11018262
Agent [candidate] (1.196 s) : 0, 1196288
Total [candidate] (11.175 s) : 0, 11175433
section profiling
Agent [baseline] (1.274 s) : 0, 1274436
Total [baseline] (10.851 s) : 0, 10850531
Agent [candidate] (1.275 s) : 0, 1274831
Total [candidate] (10.837 s) : 0, 10837454
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.055 s -
Agent appsec 1.193 s 137.393 ms (13.0%)
Agent iast 1.178 s 122.747 ms (11.6%)
Agent profiling 1.274 s 219.204 ms (20.8%)
Total tracing 10.433 s -
Total appsec 10.782 s 349.51 ms (3.4%)
Total iast 11.018 s 585.557 ms (5.6%)
Total profiling 10.851 s 417.825 ms (4.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.056 s -
Agent appsec 1.188 s 132.157 ms (12.5%)
Agent iast 1.196 s 140.408 ms (13.3%)
Agent profiling 1.275 s 218.951 ms (20.7%)
Total tracing 10.495 s -
Total appsec 10.706 s 211.668 ms (2.0%)
Total iast 11.175 s 680.868 ms (6.5%)
Total profiling 10.837 s 342.889 ms (3.3%)
gantt
    title petclinic - break down per module: candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.169 ms) : 0, 714169
BytebuddyAgent [candidate] (716.586 ms) : 0, 716586
GlobalTracer [baseline] (257.701 ms) : 0, 257701
GlobalTracer [candidate] (256.783 ms) : 0, 256783
AppSec [baseline] (55.523 ms) : 0, 55523
AppSec [candidate] (55.215 ms) : 0, 55215
Remote Config [baseline] (723.847 µs) : 0, 724
Remote Config [candidate] (722.145 µs) : 0, 722
Telemetry [baseline] (12.016 ms) : 0, 12016
Telemetry [candidate] (11.375 ms) : 0, 11375
section appsec
BytebuddyAgent [baseline] (732.426 ms) : 0, 732426
BytebuddyAgent [candidate] (729.661 ms) : 0, 729661
GlobalTracer [baseline] (254.752 ms) : 0, 254752
GlobalTracer [candidate] (253.81 ms) : 0, 253810
AppSec [baseline] (171.701 ms) : 0, 171701
AppSec [candidate] (170.613 ms) : 0, 170613
IAST [baseline] (19.761 ms) : 0, 19761
IAST [candidate] (20.306 ms) : 0, 20306
Remote Config [baseline] (672.131 µs) : 0, 672
Remote Config [candidate] (667.678 µs) : 0, 668
Telemetry [baseline] (8.095 ms) : 0, 8095
Telemetry [candidate] (8.054 ms) : 0, 8054
section iast
BytebuddyAgent [baseline] (828.023 ms) : 0, 828023
BytebuddyAgent [candidate] (841.569 ms) : 0, 841569
GlobalTracer [baseline] (246.837 ms) : 0, 246837
GlobalTracer [candidate] (249.912 ms) : 0, 249912
AppSec [baseline] (57.961 ms) : 0, 57961
AppSec [candidate] (58.285 ms) : 0, 58285
IAST [baseline] (21.099 ms) : 0, 21099
IAST [candidate] (21.792 ms) : 0, 21792
Remote Config [baseline] (646.928 µs) : 0, 647
Remote Config [candidate] (679.285 µs) : 0, 679
Telemetry [baseline] (8.461 ms) : 0, 8461
Telemetry [candidate] (8.748 ms) : 0, 8748
section profiling
BytebuddyAgent [baseline] (702.747 ms) : 0, 702747
BytebuddyAgent [candidate] (702.163 ms) : 0, 702163
GlobalTracer [baseline] (371.973 ms) : 0, 371973
GlobalTracer [candidate] (372.188 ms) : 0, 372188
AppSec [baseline] (53.629 ms) : 0, 53629
AppSec [candidate] (53.683 ms) : 0, 53683
Remote Config [baseline] (680.203 µs) : 0, 680
Remote Config [candidate] (679.378 µs) : 0, 679
Telemetry [baseline] (7.832 ms) : 0, 7832
Telemetry [candidate] (7.828 ms) : 0, 7828
ProfilingAgent [baseline] (95.575 ms) : 0, 95575
ProfilingAgent [candidate] (96.35 ms) : 0, 96350
Profiling [baseline] (95.598 ms) : 0, 95598
Profiling [candidate] (96.378 ms) : 0, 96378
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.051 s) : 0, 1050560
Total [baseline] (8.619 s) : 0, 8619058
Agent [candidate] (1.052 s) : 0, 1052010
Total [candidate] (8.626 s) : 0, 8625917
section iast
Agent [baseline] (1.181 s) : 0, 1180799
Total [baseline] (9.209 s) : 0, 9209425
Agent [candidate] (1.18 s) : 0, 1180161
Total [candidate] (9.22 s) : 0, 9219715
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.18 s) : 0, 1180294
Total [baseline] (9.204 s) : 0, 9203668
Agent [candidate] (1.179 s) : 0, 1179236
Total [candidate] (9.187 s) : 0, 9187304
section iast_TELEMETRY_OFF
Agent [baseline] (1.175 s) : 0, 1174578
Total [baseline] (9.22 s) : 0, 9220474
Agent [candidate] (1.176 s) : 0, 1176404
Total [candidate] (9.196 s) : 0, 9195569
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.051 s -
Agent iast 1.181 s 130.238 ms (12.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.18 s 129.734 ms (12.3%)
Agent iast_TELEMETRY_OFF 1.175 s 124.018 ms (11.8%)
Total tracing 8.619 s -
Total iast 9.209 s 590.367 ms (6.8%)
Total iast_HARDCODED_SECRET_DISABLED 9.204 s 584.611 ms (6.8%)
Total iast_TELEMETRY_OFF 9.22 s 601.417 ms (7.0%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.052 s -
Agent iast 1.18 s 128.15 ms (12.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.179 s 127.225 ms (12.1%)
Agent iast_TELEMETRY_OFF 1.176 s 124.394 ms (11.8%)
Total tracing 8.626 s -
Total iast 9.22 s 593.797 ms (6.9%)
Total iast_HARDCODED_SECRET_DISABLED 9.187 s 561.386 ms (6.5%)
Total iast_TELEMETRY_OFF 9.196 s 569.652 ms (6.6%)
gantt
    title insecure-bank - break down per module: candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (712.033 ms) : 0, 712033
BytebuddyAgent [candidate] (711.105 ms) : 0, 711105
GlobalTracer [baseline] (256.971 ms) : 0, 256971
GlobalTracer [candidate] (257.144 ms) : 0, 257144
AppSec [baseline] (55.261 ms) : 0, 55261
AppSec [candidate] (55.092 ms) : 0, 55092
Remote Config [baseline] (717.041 µs) : 0, 717
Remote Config [candidate] (720.159 µs) : 0, 720
Telemetry [baseline] (10.552 ms) : 0, 10552
Telemetry [candidate] (12.872 ms) : 0, 12872
section iast
BytebuddyAgent [baseline] (829.893 ms) : 0, 829893
BytebuddyAgent [candidate] (829.122 ms) : 0, 829122
GlobalTracer [baseline] (247.516 ms) : 0, 247516
GlobalTracer [candidate] (247.369 ms) : 0, 247369
AppSec [baseline] (57.954 ms) : 0, 57954
AppSec [candidate] (57.852 ms) : 0, 57852
IAST [baseline] (21.326 ms) : 0, 21326
IAST [candidate] (21.538 ms) : 0, 21538
Remote Config [baseline] (653.389 µs) : 0, 653
Remote Config [candidate] (658.12 µs) : 0, 658
Telemetry [baseline] (8.476 ms) : 0, 8476
Telemetry [candidate] (8.582 ms) : 0, 8582
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (829.13 ms) : 0, 829130
BytebuddyAgent [candidate] (828.51 ms) : 0, 828510
GlobalTracer [baseline] (247.23 ms) : 0, 247230
GlobalTracer [candidate] (247.059 ms) : 0, 247059
AppSec [baseline] (58.11 ms) : 0, 58110
AppSec [candidate] (58.011 ms) : 0, 58011
IAST [baseline] (21.542 ms) : 0, 21542
IAST [candidate] (21.365 ms) : 0, 21365
Remote Config [baseline] (675.459 µs) : 0, 675
Remote Config [candidate] (645.742 µs) : 0, 646
Telemetry [baseline] (8.527 ms) : 0, 8527
Telemetry [candidate] (8.493 ms) : 0, 8493
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (824.876 ms) : 0, 824876
BytebuddyAgent [candidate] (826.835 ms) : 0, 826835
GlobalTracer [baseline] (246.992 ms) : 0, 246992
GlobalTracer [candidate] (246.983 ms) : 0, 246983
AppSec [baseline] (57.596 ms) : 0, 57596
AppSec [candidate] (57.706 ms) : 0, 57706
IAST [baseline] (21.095 ms) : 0, 21095
IAST [candidate] (20.807 ms) : 0, 20807
Remote Config [baseline] (660.61 µs) : 0, 661
Remote Config [candidate] (641.656 µs) : 0, 642
Telemetry [baseline] (8.351 ms) : 0, 8351
Telemetry [candidate] (8.317 ms) : 0, 8317
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-12-31T09:37:11 2024-12-31T09:44:07
git_branch master jpbempel/fix-var-hoisting-rewriting
git_commit_date 1735568221 1735637173
git_commit_sha 0dc9c08 a65e6c0
release_version 1.45.0-SNAPSHOT~0dc9c087f0 1.45.0-SNAPSHOT~a65e6c0cf5
start_time 2024-12-31T09:36:57 2024-12-31T09:43:53
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1735638598 1735638598
ci_job_id 751400543 751400543
ci_pipeline_id 51934300 51934300
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

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

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0
    dateFormat X
    axisFormat %s
section baseline
no_agent (379.209 µs) : 358, 400
.   : milestone, 379,
iast (488.644 µs) : 467, 510
.   : milestone, 489,
iast_FULL (647.484 µs) : 626, 669
.   : milestone, 647,
iast_GLOBAL (519.533 µs) : 497, 542
.   : milestone, 520,
iast_HARDCODED_SECRET_DISABLED (491.087 µs) : 469, 513
.   : milestone, 491,
iast_INACTIVE (445.836 µs) : 425, 467
.   : milestone, 446,
iast_TELEMETRY_OFF (481.179 µs) : 459, 503
.   : milestone, 481,
tracing (445.431 µs) : 424, 467
.   : milestone, 445,
section candidate
no_agent (369.408 µs) : 350, 389
.   : milestone, 369,
iast (491.992 µs) : 470, 514
.   : milestone, 492,
iast_FULL (651.186 µs) : 629, 673
.   : milestone, 651,
iast_GLOBAL (508.643 µs) : 487, 530
.   : milestone, 509,
iast_HARDCODED_SECRET_DISABLED (490.864 µs) : 469, 513
.   : milestone, 491,
iast_INACTIVE (446.081 µs) : 425, 467
.   : milestone, 446,
iast_TELEMETRY_OFF (475.797 µs) : 454, 497
.   : milestone, 476,
tracing (442.587 µs) : 422, 463
.   : milestone, 443,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 379.209 µs [358.246 µs, 400.172 µs] -
iast 488.644 µs [466.832 µs, 510.455 µs] 109.435 µs (28.9%)
iast_FULL 647.484 µs [625.795 µs, 669.173 µs] 268.274 µs (70.7%)
iast_GLOBAL 519.533 µs [496.757 µs, 542.309 µs] 140.324 µs (37.0%)
iast_HARDCODED_SECRET_DISABLED 491.087 µs [469.102 µs, 513.073 µs] 111.878 µs (29.5%)
iast_INACTIVE 445.836 µs [424.677 µs, 466.995 µs] 66.627 µs (17.6%)
iast_TELEMETRY_OFF 481.179 µs [459.175 µs, 503.183 µs] 101.97 µs (26.9%)
tracing 445.431 µs [423.801 µs, 467.061 µs] 66.222 µs (17.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 369.408 µs [349.777 µs, 389.038 µs] -
iast 491.992 µs [470.26 µs, 513.724 µs] 122.585 µs (33.2%)
iast_FULL 651.186 µs [629.317 µs, 673.055 µs] 281.778 µs (76.3%)
iast_GLOBAL 508.643 µs [487.204 µs, 530.082 µs] 139.236 µs (37.7%)
iast_HARDCODED_SECRET_DISABLED 490.864 µs [469.124 µs, 512.605 µs] 121.457 µs (32.9%)
iast_INACTIVE 446.081 µs [424.994 µs, 467.168 µs] 76.674 µs (20.8%)
iast_TELEMETRY_OFF 475.797 µs [454.318 µs, 497.277 µs] 106.39 µs (28.8%)
tracing 442.587 µs [421.843 µs, 463.33 µs] 73.179 µs (19.8%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.346 ms) : 1326, 1365
.   : milestone, 1346,
appsec (1.753 ms) : 1729, 1777
.   : milestone, 1753,
appsec_no_iast (1.748 ms) : 1724, 1773
.   : milestone, 1748,
iast (1.489 ms) : 1466, 1512
.   : milestone, 1489,
profiling (1.502 ms) : 1477, 1527
.   : milestone, 1502,
tracing (1.483 ms) : 1459, 1507
.   : milestone, 1483,
section candidate
no_agent (1.347 ms) : 1327, 1368
.   : milestone, 1347,
appsec (1.741 ms) : 1717, 1764
.   : milestone, 1741,
appsec_no_iast (1.739 ms) : 1715, 1764
.   : milestone, 1739,
iast (1.506 ms) : 1484, 1529
.   : milestone, 1506,
profiling (1.527 ms) : 1502, 1552
.   : milestone, 1527,
tracing (1.489 ms) : 1462, 1516
.   : milestone, 1489,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.346 ms [1.326 ms, 1.365 ms] -
appsec 1.753 ms [1.729 ms, 1.777 ms] 406.664 µs (30.2%)
appsec_no_iast 1.748 ms [1.724 ms, 1.773 ms] 402.357 µs (29.9%)
iast 1.489 ms [1.466 ms, 1.512 ms] 143.088 µs (10.6%)
profiling 1.502 ms [1.477 ms, 1.527 ms] 155.996 µs (11.6%)
tracing 1.483 ms [1.459 ms, 1.507 ms] 137.095 µs (10.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.347 ms [1.327 ms, 1.368 ms] -
appsec 1.741 ms [1.717 ms, 1.764 ms] 393.062 µs (29.2%)
appsec_no_iast 1.739 ms [1.715 ms, 1.764 ms] 391.631 µs (29.1%)
iast 1.506 ms [1.484 ms, 1.529 ms] 158.735 µs (11.8%)
profiling 1.527 ms [1.502 ms, 1.552 ms] 179.88 µs (13.3%)
tracing 1.489 ms [1.462 ms, 1.516 ms] 141.709 µs (10.5%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-var-hoisting-rewriting
git_commit_date 1735568221 1735637173
git_commit_sha 0dc9c08 a65e6c0
release_version 1.45.0-SNAPSHOT~0dc9c087f0 1.45.0-SNAPSHOT~a65e6c0cf5
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1735639171 1735639171
ci_job_id 751400544 751400544
ci_pipeline_id 51934300 51934300
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.875 s) : 14875000, 14875000
.   : milestone, 14875000,
appsec (15.047 s) : 15047000, 15047000
.   : milestone, 15047000,
iast (19.028 s) : 19028000, 19028000
.   : milestone, 19028000,
iast_GLOBAL (17.841 s) : 17841000, 17841000
.   : milestone, 17841000,
profiling (15.071 s) : 15071000, 15071000
.   : milestone, 15071000,
tracing (15.254 s) : 15254000, 15254000
.   : milestone, 15254000,
section candidate
no_agent (15.419 s) : 15419000, 15419000
.   : milestone, 15419000,
appsec (14.761 s) : 14761000, 14761000
.   : milestone, 14761000,
iast (18.525 s) : 18525000, 18525000
.   : milestone, 18525000,
iast_GLOBAL (17.766 s) : 17766000, 17766000
.   : milestone, 17766000,
profiling (14.801 s) : 14801000, 14801000
.   : milestone, 14801000,
tracing (15.043 s) : 15043000, 15043000
.   : milestone, 15043000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.875 s [14.875 s, 14.875 s] -
appsec 15.047 s [15.047 s, 15.047 s] 172.0 ms (1.2%)
iast 19.028 s [19.028 s, 19.028 s] 4.153 s (27.9%)
iast_GLOBAL 17.841 s [17.841 s, 17.841 s] 2.966 s (19.9%)
profiling 15.071 s [15.071 s, 15.071 s] 196.0 ms (1.3%)
tracing 15.254 s [15.254 s, 15.254 s] 379.0 ms (2.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.419 s [15.419 s, 15.419 s] -
appsec 14.761 s [14.761 s, 14.761 s] -658.0 ms (-4.3%)
iast 18.525 s [18.525 s, 18.525 s] 3.106 s (20.1%)
iast_GLOBAL 17.766 s [17.766 s, 17.766 s] 2.347 s (15.2%)
profiling 14.801 s [14.801 s, 14.801 s] -618.0 ms (-4.0%)
tracing 15.043 s [15.043 s, 15.043 s] -376.0 ms (-2.4%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~a65e6c0cf5, baseline=1.45.0-SNAPSHOT~0dc9c087f0
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.465 ms) : 1453, 1476
.   : milestone, 1465,
appsec (2.342 ms) : 2301, 2384
.   : milestone, 2342,
iast (2.078 ms) : 2025, 2131
.   : milestone, 2078,
iast_GLOBAL (2.123 ms) : 2069, 2176
.   : milestone, 2123,
profiling (2.445 ms) : 2254, 2637
.   : milestone, 2445,
tracing (1.929 ms) : 1889, 1970
.   : milestone, 1929,
section candidate
no_agent (1.464 ms) : 1453, 1476
.   : milestone, 1464,
appsec (2.344 ms) : 2302, 2386
.   : milestone, 2344,
iast (2.083 ms) : 2030, 2136
.   : milestone, 2083,
iast_GLOBAL (2.123 ms) : 2070, 2176
.   : milestone, 2123,
profiling (1.954 ms) : 1912, 1996
.   : milestone, 1954,
tracing (1.93 ms) : 1889, 1971
.   : milestone, 1930,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.465 ms [1.453 ms, 1.476 ms] -
appsec 2.342 ms [2.301 ms, 2.384 ms] 877.771 µs (59.9%)
iast 2.078 ms [2.025 ms, 2.131 ms] 613.041 µs (41.9%)
iast_GLOBAL 2.123 ms [2.069 ms, 2.176 ms] 657.803 µs (44.9%)
profiling 2.445 ms [2.254 ms, 2.637 ms] 980.598 µs (66.9%)
tracing 1.929 ms [1.889 ms, 1.97 ms] 464.678 µs (31.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.464 ms [1.453 ms, 1.476 ms] -
appsec 2.344 ms [2.302 ms, 2.386 ms] 879.903 µs (60.1%)
iast 2.083 ms [2.03 ms, 2.136 ms] 618.3 µs (42.2%)
iast_GLOBAL 2.123 ms [2.07 ms, 2.176 ms] 658.174 µs (44.9%)
profiling 1.954 ms [1.912 ms, 1.996 ms] 489.482 µs (33.4%)
tracing 1.93 ms [1.889 ms, 1.971 ms] 465.59 µs (31.8%)

@@ -656,18 +657,26 @@ private void rewriteLocalVarInsn(LocalVariableNode localVar, int oldSlot, int ne
private static void rewritePreviousStoreInsn(
Copy link
Contributor

Choose a reason for hiding this comment

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

might need to update the comment above

Copy link
Member Author

Choose a reason for hiding this comment

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

done

&& (!(previous instanceof VarInsnNode) || ((VarInsnNode) previous).var != oldSlot)) {
int processed = 0;
// arbitrary fixing limit to 10 previous instructions to look at
while (!isVarStoreForSlot(previous, oldSlot) && processed < 10) {
previous = previous.getPrevious();
Copy link
Contributor

Choose a reason for hiding this comment

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

what happen if getPrevious return null?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah right I missed one test in the while. it's working for isVarStoreForLost method

In some cases the range of a local var may not have previous init
in the immediate neighborhood because of basic block arrangement.
Limit the rewirite of previous instruction for store only and looking
 back only 10 instructions
@jpbempel jpbempel force-pushed the jpbempel/fix-var-hoisting-rewriting branch from 8e854bf to a65e6c0 Compare December 31, 2024 09:26
@jpbempel jpbempel merged commit c99c2c2 into master Dec 31, 2024
150 of 151 checks passed
@jpbempel jpbempel deleted the jpbempel/fix-var-hoisting-rewriting branch December 31, 2024 14:51
@github-actions github-actions bot added this to the 1.45.0 milestone Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: debugger Dynamic Instrumentation type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants