-
Notifications
You must be signed in to change notification settings - Fork 303
Inferred Proxy Improvements #8784
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
base: master
Are you sure you want to change the base?
Conversation
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 57 metrics, 14 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.031 s) : 0, 1031235
Total [baseline] (8.696 s) : 0, 8695612
Agent [candidate] (1.02 s) : 0, 1020334
Total [candidate] (8.651 s) : 0, 8650920
section iast
Agent [baseline] (1.152 s) : 0, 1152457
Total [baseline] (9.265 s) : 0, 9265105
Agent [candidate] (1.15 s) : 0, 1150185
Total [candidate] (9.26 s) : 0, 9259706
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.15 s) : 0, 1149509
Total [baseline] (9.233 s) : 0, 9233156
Agent [candidate] (1.15 s) : 0, 1150182
Total [candidate] (9.243 s) : 0, 9243431
section iast_TELEMETRY_OFF
Agent [baseline] (1.151 s) : 0, 1151087
Total [baseline] (9.232 s) : 0, 9232105
Agent [candidate] (1.153 s) : 0, 1152707
Total [candidate] (9.302 s) : 0, 9302395
gantt
title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.981 ms) : 0, 690981
BytebuddyAgent [candidate] (681.064 ms) : 0, 681064
GlobalTracer [baseline] (241.973 ms) : 0, 241973
GlobalTracer [candidate] (239.73 ms) : 0, 239730
AppSec [baseline] (55.508 ms) : 0, 55508
AppSec [candidate] (54.338 ms) : 0, 54338
Debugger [baseline] (7.621 ms) : 0, 7621
Debugger [candidate] (10.49 ms) : 0, 10490
Remote Config [baseline] (694.4 µs) : 0, 694
Remote Config [candidate] (673.347 µs) : 0, 673
Telemetry [baseline] (10.601 ms) : 0, 10601
Telemetry [candidate] (10.46 ms) : 0, 10460
section iast
BytebuddyAgent [baseline] (805.362 ms) : 0, 805362
BytebuddyAgent [candidate] (802.299 ms) : 0, 802299
GlobalTracer [baseline] (230.959 ms) : 0, 230959
GlobalTracer [candidate] (231.655 ms) : 0, 231655
IAST [baseline] (29.101 ms) : 0, 29101
IAST [candidate] (28.408 ms) : 0, 28408
AppSec [baseline] (48.556 ms) : 0, 48556
AppSec [candidate] (48.447 ms) : 0, 48447
Debugger [baseline] (5.847 ms) : 0, 5847
Debugger [candidate] (5.901 ms) : 0, 5901
Remote Config [baseline] (591.58 µs) : 0, 592
Remote Config [candidate] (594.784 µs) : 0, 595
Telemetry [baseline] (7.829 ms) : 0, 7829
Telemetry [candidate] (7.882 ms) : 0, 7882
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (801.937 ms) : 0, 801937
BytebuddyAgent [candidate] (802.249 ms) : 0, 802249
GlobalTracer [baseline] (230.807 ms) : 0, 230807
GlobalTracer [candidate] (230.941 ms) : 0, 230941
IAST [baseline] (28.4 ms) : 0, 28400
IAST [candidate] (29.208 ms) : 0, 29208
AppSec [baseline] (50.332 ms) : 0, 50332
AppSec [candidate] (49.774 ms) : 0, 49774
Debugger [baseline] (5.94 ms) : 0, 5940
Debugger [candidate] (5.977 ms) : 0, 5977
Remote Config [baseline] (596.476 µs) : 0, 596
Remote Config [candidate] (601.434 µs) : 0, 601
Telemetry [baseline] (7.911 ms) : 0, 7911
Telemetry [candidate] (7.918 ms) : 0, 7918
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (803.696 ms) : 0, 803696
BytebuddyAgent [candidate] (804.868 ms) : 0, 804868
GlobalTracer [baseline] (231.478 ms) : 0, 231478
GlobalTracer [candidate] (231.923 ms) : 0, 231923
IAST [baseline] (23.821 ms) : 0, 23821
IAST [candidate] (22.385 ms) : 0, 22385
AppSec [baseline] (54.091 ms) : 0, 54091
AppSec [candidate] (55.541 ms) : 0, 55541
Debugger [baseline] (5.96 ms) : 0, 5960
Debugger [candidate] (5.939 ms) : 0, 5939
Remote Config [baseline] (612.366 µs) : 0, 612
Remote Config [candidate] (598.494 µs) : 0, 598
Telemetry [baseline] (7.799 ms) : 0, 7799
Telemetry [candidate] (7.761 ms) : 0, 7761
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.026 s) : 0, 1026058
Total [baseline] (10.523 s) : 0, 10523305
Agent [candidate] (1.021 s) : 0, 1021003
Total [candidate] (10.554 s) : 0, 10554423
section appsec
Agent [baseline] (1.16 s) : 0, 1160305
Total [baseline] (10.736 s) : 0, 10736347
Agent [candidate] (1.164 s) : 0, 1164302
Total [candidate] (10.732 s) : 0, 10731902
section iast
Agent [baseline] (1.146 s) : 0, 1146124
Total [baseline] (10.935 s) : 0, 10935486
Agent [candidate] (1.149 s) : 0, 1148780
Total [candidate] (10.931 s) : 0, 10930515
section profiling
Agent [baseline] (1.282 s) : 0, 1281692
Total [baseline] (10.857 s) : 0, 10857361
Agent [candidate] (1.277 s) : 0, 1276928
Total [candidate] (10.829 s) : 0, 10828886
gantt
title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.027 ms) : 0, 687027
BytebuddyAgent [candidate] (683.448 ms) : 0, 683448
GlobalTracer [baseline] (240.352 ms) : 0, 240352
GlobalTracer [candidate] (240.339 ms) : 0, 240339
AppSec [baseline] (56.01 ms) : 0, 56010
AppSec [candidate] (54.498 ms) : 0, 54498
Debugger [baseline] (7.651 ms) : 0, 7651
Debugger [candidate] (7.856 ms) : 0, 7856
Remote Config [baseline] (688.035 µs) : 0, 688
Remote Config [candidate] (705.505 µs) : 0, 706
Telemetry [baseline] (10.625 ms) : 0, 10625
Telemetry [candidate] (10.649 ms) : 0, 10649
section appsec
BytebuddyAgent [baseline] (699.988 ms) : 0, 699988
BytebuddyAgent [candidate] (702.614 ms) : 0, 702614
GlobalTracer [baseline] (236.538 ms) : 0, 236538
GlobalTracer [candidate] (237.307 ms) : 0, 237307
AppSec [baseline] (174.775 ms) : 0, 174775
AppSec [candidate] (175.233 ms) : 0, 175233
Debugger [baseline] (5.956 ms) : 0, 5956
Debugger [candidate] (5.959 ms) : 0, 5959
Remote Config [baseline] (625.536 µs) : 0, 626
Remote Config [candidate] (632.461 µs) : 0, 632
Telemetry [baseline] (8.092 ms) : 0, 8092
Telemetry [candidate] (8.083 ms) : 0, 8083
IAST [baseline] (21.67 ms) : 0, 21670
IAST [candidate] (21.887 ms) : 0, 21887
section iast
BytebuddyAgent [baseline] (800.373 ms) : 0, 800373
BytebuddyAgent [candidate] (801.897 ms) : 0, 801897
GlobalTracer [baseline] (229.542 ms) : 0, 229542
GlobalTracer [candidate] (230.571 ms) : 0, 230571
AppSec [baseline] (50.871 ms) : 0, 50871
AppSec [candidate] (51.192 ms) : 0, 51192
Debugger [baseline] (5.894 ms) : 0, 5894
Debugger [candidate] (5.912 ms) : 0, 5912
Remote Config [baseline] (593.521 µs) : 0, 594
Remote Config [candidate] (596.913 µs) : 0, 597
Telemetry [baseline] (7.836 ms) : 0, 7836
Telemetry [candidate] (7.841 ms) : 0, 7841
IAST [baseline] (26.765 ms) : 0, 26765
IAST [candidate] (25.845 ms) : 0, 25845
section profiling
BytebuddyAgent [baseline] (673.065 ms) : 0, 673065
BytebuddyAgent [candidate] (671.49 ms) : 0, 671490
GlobalTracer [baseline] (378.981 ms) : 0, 378981
GlobalTracer [candidate] (377.156 ms) : 0, 377156
AppSec [baseline] (54.944 ms) : 0, 54944
AppSec [candidate] (53.449 ms) : 0, 53449
Debugger [baseline] (6.13 ms) : 0, 6130
Debugger [candidate] (6.134 ms) : 0, 6134
Remote Config [baseline] (666.151 µs) : 0, 666
Remote Config [candidate] (650.312 µs) : 0, 650
Telemetry [baseline] (8.125 ms) : 0, 8125
Telemetry [candidate] (8.147 ms) : 0, 8147
ProfilingAgent [baseline] (109.095 ms) : 0, 109095
ProfilingAgent [candidate] (109.475 ms) : 0, 109475
Profiling [baseline] (109.121 ms) : 0, 109121
Profiling [candidate] (109.502 ms) : 0, 109502
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section baseline
no_agent (1.357 ms) : 1338, 1376
. : milestone, 1357,
appsec (1.747 ms) : 1724, 1771
. : milestone, 1747,
appsec_no_iast (1.728 ms) : 1704, 1751
. : milestone, 1728,
code_origins (1.662 ms) : 1635, 1689
. : milestone, 1662,
iast (1.526 ms) : 1502, 1550
. : milestone, 1526,
profiling (1.561 ms) : 1537, 1585
. : milestone, 1561,
tracing (1.483 ms) : 1460, 1506
. : milestone, 1483,
section candidate
no_agent (1.342 ms) : 1323, 1361
. : milestone, 1342,
appsec (1.744 ms) : 1720, 1768
. : milestone, 1744,
appsec_no_iast (1.733 ms) : 1710, 1757
. : milestone, 1733,
code_origins (1.663 ms) : 1636, 1690
. : milestone, 1663,
iast (1.515 ms) : 1491, 1539
. : milestone, 1515,
profiling (1.526 ms) : 1501, 1550
. : milestone, 1526,
tracing (1.503 ms) : 1478, 1528
. : milestone, 1503,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section baseline
no_agent (379.961 µs) : 359, 400
. : milestone, 380,
iast (509.302 µs) : 488, 531
. : milestone, 509,
iast_FULL (730.826 µs) : 709, 753
. : milestone, 731,
iast_GLOBAL (559.502 µs) : 538, 581
. : milestone, 560,
iast_HARDCODED_SECRET_DISABLED (515.47 µs) : 493, 538
. : milestone, 515,
iast_INACTIVE (462.949 µs) : 441, 485
. : milestone, 463,
iast_TELEMETRY_OFF (512.29 µs) : 489, 535
. : milestone, 512,
tracing (459.569 µs) : 437, 482
. : milestone, 460,
section candidate
no_agent (377.422 µs) : 357, 398
. : milestone, 377,
iast (522.34 µs) : 500, 545
. : milestone, 522,
iast_FULL (732.645 µs) : 711, 754
. : milestone, 733,
iast_GLOBAL (570.898 µs) : 548, 594
. : milestone, 571,
iast_HARDCODED_SECRET_DISABLED (515.897 µs) : 493, 539
. : milestone, 516,
iast_INACTIVE (465.975 µs) : 443, 488
. : milestone, 466,
iast_TELEMETRY_OFF (512.473 µs) : 489, 536
. : milestone, 512,
tracing (460.406 µs) : 439, 482
. : milestone, 460,
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.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section baseline
no_agent (15.504 s) : 15504000, 15504000
. : milestone, 15504000,
appsec (14.684 s) : 14684000, 14684000
. : milestone, 14684000,
iast (18.564 s) : 18564000, 18564000
. : milestone, 18564000,
iast_GLOBAL (18.134 s) : 18134000, 18134000
. : milestone, 18134000,
profiling (14.993 s) : 14993000, 14993000
. : milestone, 14993000,
tracing (15.207 s) : 15207000, 15207000
. : milestone, 15207000,
section candidate
no_agent (14.954 s) : 14954000, 14954000
. : milestone, 14954000,
appsec (15.169 s) : 15169000, 15169000
. : milestone, 15169000,
iast (18.792 s) : 18792000, 18792000
. : milestone, 18792000,
iast_GLOBAL (18.076 s) : 18076000, 18076000
. : milestone, 18076000,
profiling (15.146 s) : 15146000, 15146000
. : milestone, 15146000,
tracing (14.956 s) : 14956000, 14956000
. : milestone, 14956000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~457db927ac, baseline=1.50.0-SNAPSHOT~d5d53cd553
dateFormat X
axisFormat %s
section baseline
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (2.388 ms) : 2341, 2436
. : milestone, 2388,
iast (2.164 ms) : 2105, 2224
. : milestone, 2164,
iast_GLOBAL (2.206 ms) : 2146, 2266
. : milestone, 2206,
profiling (2.011 ms) : 1964, 2059
. : milestone, 2011,
tracing (1.988 ms) : 1942, 2033
. : milestone, 1988,
section candidate
no_agent (1.475 ms) : 1464, 1487
. : milestone, 1475,
appsec (2.38 ms) : 2333, 2427
. : milestone, 2380,
iast (2.159 ms) : 2100, 2218
. : milestone, 2159,
iast_GLOBAL (2.203 ms) : 2143, 2263
. : milestone, 2203,
profiling (2.02 ms) : 1972, 2069
. : milestone, 2020,
tracing (2.003 ms) : 1957, 2049
. : milestone, 2003,
|
@@ -9,19 +9,23 @@ public class InferredProxyContext implements ImplicitContextKeyed { | |||
ContextKey.named("inferred-proxy-key"); | |||
private final Map<String, String> inferredProxy; | |||
|
|||
// at most 6 x-dd-proxy http headers to be extracted and stored into the Context hashmap, | |||
// following API Gateway RFC | |||
private final int DEFAULT_CAPACITY = 6; |
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.
HashMap uses a load factor of 0.75, so if you use 6 as the initial capacity it will rehash when you add the 5th entry
I'd suggest using a capacity of 8 (6 / 0.75) which would let you add 6 entries without rehashing.
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.
Just a suggestion about taking the load factor (default 0.75) into account when sizing hash maps
What Does This Do
Minor additional follow up changes for #8336
InferredProxyContext
following up from https://github.com/DataDog/dd-trace-java/pull/8336/files#r2076031132Motivation
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: [PROJ-IDENT]