-
Notifications
You must be signed in to change notification settings - Fork 292
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
Avoid duplicate class symbol extraction #7919
Conversation
Same classes can be loaded in different classloader, but symbol-wise they are the same. In some situation (like Groovy script) we can a lot of class loaded for same symbols which pollute SymDB backend. We need to track all classes loaded and extracted into ClassNameTrie that is space efficient prefix tree. That way we prevent any duplicates reaching SymDB backend
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
Debugger benchmarksParameters
See matching parameters
SummaryFound 4 performance improvements and 0 performance regressions! Performance is the same for 5 metrics, 6 unstable metrics.
See unchanged results
Request duration reports for reportsgantt
title reports - request duration [CI 0.99] : candidate=None, baseline=None
dateFormat X
axisFormat %s
section baseline
noprobe (296.157 µs) : 270, 322
. : milestone, 296,
basic (301.463 µs) : 294, 309
. : milestone, 301,
loop (10.596 ms) : 10535, 10658
. : milestone, 10596,
section candidate
noprobe (299.338 µs) : 269, 330
. : milestone, 299,
basic (302.769 µs) : 293, 313
. : milestone, 303,
loop (10.263 ms) : 10237, 10288
. : milestone, 10263,
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.078 s) : 0, 1077850
Total [baseline] (8.519 s) : 0, 8518901
Agent [candidate] (1.079 s) : 0, 1079417
Total [candidate] (8.531 s) : 0, 8530611
section iast
Agent [baseline] (1.206 s) : 0, 1206268
Total [baseline] (9.106 s) : 0, 9105540
Agent [candidate] (1.204 s) : 0, 1204194
Total [candidate] (9.129 s) : 0, 9128902
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.203 s) : 0, 1202911
Total [baseline] (9.063 s) : 0, 9062565
Agent [candidate] (1.202 s) : 0, 1202424
Total [candidate] (9.05 s) : 0, 9050186
section iast_TELEMETRY_OFF
Agent [baseline] (1.21 s) : 0, 1209882
Total [baseline] (9.114 s) : 0, 9114338
Agent [candidate] (1.211 s) : 0, 1210790
Total [candidate] (9.092 s) : 0, 9092178
gantt
title insecure-bank - break down per module: candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (686.155 ms) : 0, 686155
BytebuddyAgent [candidate] (685.796 ms) : 0, 685796
GlobalTracer [baseline] (314.179 ms) : 0, 314179
GlobalTracer [candidate] (314.311 ms) : 0, 314311
AppSec [baseline] (54.096 ms) : 0, 54096
AppSec [candidate] (53.791 ms) : 0, 53791
Remote Config [baseline] (674.554 µs) : 0, 675
Remote Config [candidate] (679.134 µs) : 0, 679
Telemetry [baseline] (9.141 ms) : 0, 9141
Telemetry [candidate] (11.213 ms) : 0, 11213
section iast
BytebuddyAgent [baseline] (803.483 ms) : 0, 803483
BytebuddyAgent [candidate] (801.248 ms) : 0, 801248
GlobalTracer [baseline] (303.828 ms) : 0, 303828
GlobalTracer [candidate] (303.058 ms) : 0, 303058
AppSec [baseline] (56.948 ms) : 0, 56948
AppSec [candidate] (57.497 ms) : 0, 57497
IAST [baseline] (20.371 ms) : 0, 20371
IAST [candidate] (20.547 ms) : 0, 20547
Remote Config [baseline] (610.703 µs) : 0, 611
Remote Config [candidate] (608.682 µs) : 0, 609
Telemetry [baseline] (7.343 ms) : 0, 7343
Telemetry [candidate] (7.553 ms) : 0, 7553
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (800.451 ms) : 0, 800451
BytebuddyAgent [candidate] (799.707 ms) : 0, 799707
GlobalTracer [baseline] (303.124 ms) : 0, 303124
GlobalTracer [candidate] (303.479 ms) : 0, 303479
AppSec [baseline] (55.686 ms) : 0, 55686
AppSec [candidate] (56.397 ms) : 0, 56397
IAST [baseline] (22.033 ms) : 0, 22033
IAST [candidate] (21.195 ms) : 0, 21195
Remote Config [baseline] (612.079 µs) : 0, 612
Remote Config [candidate] (627.25 µs) : 0, 627
Telemetry [baseline] (7.377 ms) : 0, 7377
Telemetry [candidate] (7.387 ms) : 0, 7387
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (804.401 ms) : 0, 804401
BytebuddyAgent [candidate] (805.102 ms) : 0, 805102
GlobalTracer [baseline] (304.866 ms) : 0, 304866
GlobalTracer [candidate] (305.849 ms) : 0, 305849
AppSec [baseline] (58.651 ms) : 0, 58651
AppSec [candidate] (56.861 ms) : 0, 56861
IAST [baseline] (20.221 ms) : 0, 20221
IAST [candidate] (21.216 ms) : 0, 21216
Remote Config [baseline] (602.663 µs) : 0, 603
Remote Config [candidate] (608.413 µs) : 0, 608
Telemetry [baseline] (7.442 ms) : 0, 7442
Telemetry [candidate] (7.395 ms) : 0, 7395
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.078 s) : 0, 1077513
Total [baseline] (10.363 s) : 0, 10363477
Agent [candidate] (1.095 s) : 0, 1094712
Total [candidate] (10.314 s) : 0, 10314349
section appsec
Agent [baseline] (1.211 s) : 0, 1211340
Total [baseline] (10.598 s) : 0, 10598140
Agent [candidate] (1.216 s) : 0, 1215740
Total [candidate] (10.62 s) : 0, 10620388
section iast
Agent [baseline] (1.201 s) : 0, 1201002
Total [baseline] (10.829 s) : 0, 10828747
Agent [candidate] (1.206 s) : 0, 1205921
Total [candidate] (10.793 s) : 0, 10793245
section profiling
Agent [baseline] (1.285 s) : 0, 1285448
Total [baseline] (10.684 s) : 0, 10684030
Agent [candidate] (1.286 s) : 0, 1285535
Total [candidate] (10.74 s) : 0, 10740475
gantt
title petclinic - break down per module: candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (684.728 ms) : 0, 684728
BytebuddyAgent [candidate] (697.064 ms) : 0, 697064
GlobalTracer [baseline] (313.923 ms) : 0, 313923
GlobalTracer [candidate] (319.229 ms) : 0, 319229
AppSec [baseline] (53.924 ms) : 0, 53924
AppSec [candidate] (54.609 ms) : 0, 54609
Remote Config [baseline] (673.281 µs) : 0, 673
Remote Config [candidate] (689.02 µs) : 0, 689
Telemetry [baseline] (10.616 ms) : 0, 10616
Telemetry [candidate] (9.286 ms) : 0, 9286
section appsec
BytebuddyAgent [baseline] (702.216 ms) : 0, 702216
BytebuddyAgent [candidate] (705.055 ms) : 0, 705055
GlobalTracer [baseline] (311.86 ms) : 0, 311860
GlobalTracer [candidate] (313.08 ms) : 0, 313080
AppSec [baseline] (165.227 ms) : 0, 165227
AppSec [candidate] (165.227 ms) : 0, 165227
Remote Config [baseline] (639.522 µs) : 0, 640
Remote Config [candidate] (635.808 µs) : 0, 636
Telemetry [baseline] (7.765 ms) : 0, 7765
Telemetry [candidate] (8.483 ms) : 0, 8483
IAST [baseline] (20.1 ms) : 0, 20100
IAST [candidate] (19.264 ms) : 0, 19264
section iast
BytebuddyAgent [baseline] (798.342 ms) : 0, 798342
BytebuddyAgent [candidate] (802.422 ms) : 0, 802422
GlobalTracer [baseline] (303.515 ms) : 0, 303515
GlobalTracer [candidate] (304.025 ms) : 0, 304025
AppSec [baseline] (56.336 ms) : 0, 56336
AppSec [candidate] (56.424 ms) : 0, 56424
Remote Config [baseline] (615.824 µs) : 0, 616
Remote Config [candidate] (602.76 µs) : 0, 603
Telemetry [baseline] (7.417 ms) : 0, 7417
Telemetry [candidate] (7.408 ms) : 0, 7408
IAST [baseline] (21.19 ms) : 0, 21190
IAST [candidate] (21.305 ms) : 0, 21305
section profiling
ProfilingAgent [baseline] (93.737 ms) : 0, 93737
ProfilingAgent [candidate] (94.449 ms) : 0, 94449
BytebuddyAgent [baseline] (685.662 ms) : 0, 685662
BytebuddyAgent [candidate] (685.951 ms) : 0, 685951
GlobalTracer [baseline] (400.297 ms) : 0, 400297
GlobalTracer [candidate] (399.005 ms) : 0, 399005
AppSec [baseline] (54.843 ms) : 0, 54843
AppSec [candidate] (54.849 ms) : 0, 54849
Remote Config [baseline] (664.99 µs) : 0, 665
Remote Config [candidate] (682.931 µs) : 0, 683
Telemetry [baseline] (11.255 ms) : 0, 11255
Telemetry [candidate] (11.536 ms) : 0, 11536
Profiling [baseline] (93.761 ms) : 0, 93761
Profiling [candidate] (94.473 ms) : 0, 94473
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 11 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section baseline
no_agent (373.025 µs) : 353, 393
. : milestone, 373,
iast (495.566 µs) : 474, 517
. : milestone, 496,
iast_FULL (653.821 µs) : 632, 675
. : milestone, 654,
iast_GLOBAL (516.041 µs) : 495, 537
. : milestone, 516,
iast_HARDCODED_SECRET_DISABLED (491.562 µs) : 470, 513
. : milestone, 492,
iast_INACTIVE (454.313 µs) : 433, 475
. : milestone, 454,
iast_TELEMETRY_OFF (475.516 µs) : 454, 497
. : milestone, 476,
tracing (446.352 µs) : 425, 467
. : milestone, 446,
section candidate
no_agent (371.747 µs) : 352, 391
. : milestone, 372,
iast (488.891 µs) : 468, 510
. : milestone, 489,
iast_FULL (647.479 µs) : 626, 669
. : milestone, 647,
iast_GLOBAL (514.917 µs) : 494, 536
. : milestone, 515,
iast_HARDCODED_SECRET_DISABLED (495.454 µs) : 474, 517
. : milestone, 495,
iast_INACTIVE (448.54 µs) : 427, 470
. : milestone, 449,
iast_TELEMETRY_OFF (480.213 µs) : 459, 502
. : milestone, 480,
tracing (455.814 µs) : 435, 477
. : milestone, 456,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section baseline
no_agent (1.342 ms) : 1322, 1361
. : milestone, 1342,
appsec (1.739 ms) : 1715, 1764
. : milestone, 1739,
appsec_no_iast (1.745 ms) : 1721, 1769
. : milestone, 1745,
iast (1.501 ms) : 1479, 1523
. : milestone, 1501,
profiling (1.497 ms) : 1473, 1521
. : milestone, 1497,
tracing (1.451 ms) : 1426, 1475
. : milestone, 1451,
section candidate
no_agent (1.346 ms) : 1327, 1365
. : milestone, 1346,
appsec (1.744 ms) : 1719, 1768
. : milestone, 1744,
appsec_no_iast (1.735 ms) : 1711, 1759
. : milestone, 1735,
iast (1.479 ms) : 1457, 1501
. : milestone, 1479,
profiling (1.561 ms) : 1537, 1585
. : milestone, 1561,
tracing (1.474 ms) : 1449, 1498
. : milestone, 1474,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section baseline
no_agent (15.076 s) : 15076000, 15076000
. : milestone, 15076000,
appsec (15.382 s) : 15382000, 15382000
. : milestone, 15382000,
iast (19.077 s) : 19077000, 19077000
. : milestone, 19077000,
iast_GLOBAL (18.273 s) : 18273000, 18273000
. : milestone, 18273000,
profiling (14.905 s) : 14905000, 14905000
. : milestone, 14905000,
tracing (15.044 s) : 15044000, 15044000
. : milestone, 15044000,
section candidate
no_agent (15.369 s) : 15369000, 15369000
. : milestone, 15369000,
appsec (15.342 s) : 15342000, 15342000
. : milestone, 15342000,
iast (18.598 s) : 18598000, 18598000
. : milestone, 18598000,
iast_GLOBAL (18.197 s) : 18197000, 18197000
. : milestone, 18197000,
profiling (15.079 s) : 15079000, 15079000
. : milestone, 15079000,
tracing (15.183 s) : 15183000, 15183000
. : milestone, 15183000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~60ab16c83e, baseline=1.43.0-SNAPSHOT~8b3103079b
dateFormat X
axisFormat %s
section baseline
no_agent (1.472 ms) : 1460, 1483
. : milestone, 1472,
appsec (2.336 ms) : 2295, 2378
. : milestone, 2336,
iast (2.083 ms) : 2030, 2135
. : milestone, 2083,
iast_GLOBAL (2.11 ms) : 2058, 2162
. : milestone, 2110,
profiling (1.926 ms) : 1885, 1967
. : milestone, 1926,
tracing (1.908 ms) : 1869, 1947
. : milestone, 1908,
section candidate
no_agent (1.465 ms) : 1454, 1477
. : milestone, 1465,
appsec (2.336 ms) : 2294, 2377
. : milestone, 2336,
iast (2.079 ms) : 2027, 2132
. : milestone, 2079,
iast_GLOBAL (2.133 ms) : 2079, 2186
. : milestone, 2133,
profiling (1.943 ms) : 1900, 1986
. : milestone, 1943,
tracing (1.919 ms) : 1879, 1959
. : milestone, 1919,
|
Set<String> localLoadedClasses = loadedClasses; | ||
if (localLoadedClasses != null && !localLoadedClasses.add(className)) { | ||
// class already loaded and symbol extracted | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand: Shouldn't we have filtered duplicates with this code already? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only at reload time when we are processing already loaded classes.
after that we dropped the Set
Now it's permanent
|
||
void loadedClassesProcessEnded() { | ||
loadedClasses = null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha! I see now :) Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
What Does This Do
We need to track all classes loaded and extracted into ClassNameTrie that is space efficient prefix tree. That way we prevent any duplicates reaching SymDB backend
Motivation
Same classes can be loaded in different classloader, but symbol-wise they are the same. In some situation (like Groovy script) we can a lot
of class loaded for same symbols which pollute SymDB backend.
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: DEBUG-3114