Conversation
Debugger benchmarksParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 9 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 (301.441 µs) : 249, 354
. : milestone, 301,
basic (293.392 µs) : 283, 304
. : milestone, 293,
loop (10.504 ms) : 10485, 10523
. : milestone, 10504,
section candidate
noprobe (297.182 µs) : 261, 334
. : milestone, 297,
basic (297.09 µs) : 287, 307
. : milestone, 297,
loop (10.527 ms) : 10500, 10554
. : milestone, 10527,
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 15 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044807
Total [baseline] (8.486 s) : 0, 8485506
Agent [candidate] (1.048 s) : 0, 1048303
Total [candidate] (8.479 s) : 0, 8478883
section iast
Agent [baseline] (1.172 s) : 0, 1171578
Total [baseline] (8.971 s) : 0, 8970996
Agent [candidate] (1.171 s) : 0, 1171296
Total [candidate] (8.94 s) : 0, 8940289
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.171 s) : 0, 1170761
Total [baseline] (8.96 s) : 0, 8960295
Agent [candidate] (1.182 s) : 0, 1181976
Total [candidate] (8.939 s) : 0, 8939195
section iast_TELEMETRY_OFF
Agent [baseline] (1.178 s) : 0, 1178228
Total [baseline] (8.999 s) : 0, 8998504
Agent [candidate] (1.17 s) : 0, 1170302
Total [candidate] (8.996 s) : 0, 8996495
gantt
title insecure-bank - break down per module: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (666.719 ms) : 0, 666719
BytebuddyAgent [candidate] (669.594 ms) : 0, 669594
GlobalTracer [baseline] (305.114 ms) : 0, 305114
GlobalTracer [candidate] (306.035 ms) : 0, 306035
AppSec [baseline] (51.205 ms) : 0, 51205
AppSec [candidate] (51.075 ms) : 0, 51075
Remote Config [baseline] (664.426 µs) : 0, 664
Remote Config [candidate] (663.142 µs) : 0, 663
Telemetry [baseline] (7.557 ms) : 0, 7557
Telemetry [candidate] (7.441 ms) : 0, 7441
section iast
BytebuddyAgent [baseline] (776.841 ms) : 0, 776841
BytebuddyAgent [candidate] (778.215 ms) : 0, 778215
GlobalTracer [baseline] (295.97 ms) : 0, 295970
GlobalTracer [candidate] (295.838 ms) : 0, 295838
AppSec [baseline] (49.652 ms) : 0, 49652
AppSec [candidate] (51.051 ms) : 0, 51051
IAST [baseline] (24.545 ms) : 0, 24545
IAST [candidate] (23.372 ms) : 0, 23372
Remote Config [baseline] (605.718 µs) : 0, 606
Remote Config [candidate] (595.567 µs) : 0, 596
Telemetry [baseline] (10.395 ms) : 0, 10395
Telemetry [candidate] (8.744 ms) : 0, 8744
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (776.568 ms) : 0, 776568
BytebuddyAgent [candidate] (785.104 ms) : 0, 785104
GlobalTracer [baseline] (295.886 ms) : 0, 295886
GlobalTracer [candidate] (298.481 ms) : 0, 298481
AppSec [baseline] (49.467 ms) : 0, 49467
AppSec [candidate] (54.25 ms) : 0, 54250
IAST [baseline] (25.914 ms) : 0, 25914
IAST [candidate] (22.73 ms) : 0, 22730
Remote Config [baseline] (594.891 µs) : 0, 595
Remote Config [candidate] (591.555 µs) : 0, 592
Telemetry [baseline] (8.766 ms) : 0, 8766
Telemetry [candidate] (7.24 ms) : 0, 7240
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (781.571 ms) : 0, 781571
BytebuddyAgent [candidate] (777.451 ms) : 0, 777451
GlobalTracer [baseline] (297.85 ms) : 0, 297850
GlobalTracer [candidate] (297.143 ms) : 0, 297143
AppSec [baseline] (50.765 ms) : 0, 50765
AppSec [candidate] (52.231 ms) : 0, 52231
IAST [baseline] (25.065 ms) : 0, 25065
IAST [candidate] (22.228 ms) : 0, 22228
Remote Config [baseline] (593.324 µs) : 0, 593
Remote Config [candidate] (577.709 µs) : 0, 578
Telemetry [baseline] (8.682 ms) : 0, 8682
Telemetry [candidate] (7.167 ms) : 0, 7167
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047719
Total [baseline] (10.385 s) : 0, 10385203
Agent [candidate] (1.049 s) : 0, 1048866
Total [candidate] (10.33 s) : 0, 10329883
section appsec
Agent [baseline] (1.177 s) : 0, 1177129
Total [baseline] (10.543 s) : 0, 10543382
Agent [candidate] (1.175 s) : 0, 1174681
Total [candidate] (10.455 s) : 0, 10455386
section iast
Agent [baseline] (1.173 s) : 0, 1173042
Total [baseline] (10.765 s) : 0, 10764784
Agent [candidate] (1.179 s) : 0, 1179098
Total [candidate] (10.879 s) : 0, 10879116
section profiling
Agent [baseline] (1.258 s) : 0, 1257636
Total [baseline] (10.646 s) : 0, 10646338
Agent [candidate] (1.253 s) : 0, 1252628
Total [candidate] (10.576 s) : 0, 10576352
gantt
title petclinic - break down per module: candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (668.578 ms) : 0, 668578
BytebuddyAgent [candidate] (669.594 ms) : 0, 669594
GlobalTracer [baseline] (306.338 ms) : 0, 306338
GlobalTracer [candidate] (306.247 ms) : 0, 306247
AppSec [baseline] (51.139 ms) : 0, 51139
AppSec [candidate] (51.393 ms) : 0, 51393
Remote Config [baseline] (657.977 µs) : 0, 658
Remote Config [candidate] (664.769 µs) : 0, 665
Telemetry [baseline] (7.455 ms) : 0, 7455
Telemetry [candidate] (7.464 ms) : 0, 7464
section appsec
BytebuddyAgent [baseline] (683.847 ms) : 0, 683847
BytebuddyAgent [candidate] (681.724 ms) : 0, 681724
GlobalTracer [baseline] (302.479 ms) : 0, 302479
GlobalTracer [candidate] (301.094 ms) : 0, 301094
AppSec [baseline] (160.151 ms) : 0, 160151
AppSec [candidate] (157.293 ms) : 0, 157293
Remote Config [baseline] (636.846 µs) : 0, 637
Remote Config [candidate] (611.678 µs) : 0, 612
Telemetry [baseline] (7.128 ms) : 0, 7128
Telemetry [candidate] (10.009 ms) : 0, 10009
IAST [baseline] (18.435 ms) : 0, 18435
IAST [candidate] (20.817 ms) : 0, 20817
section iast
BytebuddyAgent [baseline] (778.559 ms) : 0, 778559
BytebuddyAgent [candidate] (783.734 ms) : 0, 783734
GlobalTracer [baseline] (296.257 ms) : 0, 296257
GlobalTracer [candidate] (297.497 ms) : 0, 297497
AppSec [baseline] (51.049 ms) : 0, 51049
AppSec [candidate] (53.336 ms) : 0, 53336
Remote Config [baseline] (598.65 µs) : 0, 599
Remote Config [candidate] (584.996 µs) : 0, 585
Telemetry [baseline] (7.895 ms) : 0, 7895
Telemetry [candidate] (7.903 ms) : 0, 7903
IAST [baseline] (25.047 ms) : 0, 25047
IAST [candidate] (22.482 ms) : 0, 22482
section profiling
BytebuddyAgent [baseline] (671.234 ms) : 0, 671234
BytebuddyAgent [candidate] (668.571 ms) : 0, 668571
GlobalTracer [baseline] (392.435 ms) : 0, 392435
GlobalTracer [candidate] (390.665 ms) : 0, 390665
AppSec [baseline] (52.425 ms) : 0, 52425
AppSec [candidate] (52.805 ms) : 0, 52805
Remote Config [baseline] (691.205 µs) : 0, 691
Remote Config [candidate] (689.29 µs) : 0, 689
Telemetry [baseline] (7.414 ms) : 0, 7414
Telemetry [candidate] (7.401 ms) : 0, 7401
ProfilingAgent [baseline] (95.667 ms) : 0, 95667
ProfilingAgent [candidate] (95.01 ms) : 0, 95010
Profiling [baseline] (95.691 ms) : 0, 95691
Profiling [candidate] (95.036 ms) : 0, 95036
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section baseline
no_agent (1.348 ms) : 1328, 1368
. : milestone, 1348,
appsec (1.728 ms) : 1704, 1753
. : milestone, 1728,
appsec_no_iast (1.768 ms) : 1744, 1791
. : milestone, 1768,
iast (1.508 ms) : 1486, 1530
. : milestone, 1508,
profiling (1.512 ms) : 1488, 1537
. : milestone, 1512,
tracing (1.479 ms) : 1455, 1503
. : milestone, 1479,
section candidate
no_agent (1.342 ms) : 1323, 1362
. : milestone, 1342,
appsec (1.723 ms) : 1699, 1748
. : milestone, 1723,
appsec_no_iast (1.723 ms) : 1698, 1748
. : milestone, 1723,
iast (1.495 ms) : 1472, 1518
. : milestone, 1495,
profiling (1.519 ms) : 1493, 1545
. : milestone, 1519,
tracing (1.475 ms) : 1452, 1499
. : milestone, 1475,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section baseline
no_agent (373.953 µs) : 354, 394
. : milestone, 374,
iast (481.252 µs) : 459, 504
. : milestone, 481,
iast_FULL (556.679 µs) : 536, 578
. : milestone, 557,
iast_GLOBAL (513.5 µs) : 492, 535
. : milestone, 514,
iast_HARDCODED_SECRET_DISABLED (491.705 µs) : 469, 514
. : milestone, 492,
iast_INACTIVE (454.145 µs) : 432, 476
. : milestone, 454,
iast_TELEMETRY_OFF (483.045 µs) : 460, 506
. : milestone, 483,
tracing (449.431 µs) : 429, 470
. : milestone, 449,
section candidate
no_agent (370.929 µs) : 352, 390
. : milestone, 371,
iast (488.895 µs) : 467, 511
. : milestone, 489,
iast_FULL (556.294 µs) : 534, 578
. : milestone, 556,
iast_GLOBAL (510.378 µs) : 488, 533
. : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (484.932 µs) : 463, 507
. : milestone, 485,
iast_INACTIVE (448.266 µs) : 428, 469
. : milestone, 448,
iast_TELEMETRY_OFF (478.975 µs) : 457, 500
. : milestone, 479,
tracing (438.103 µs) : 418, 459
. : milestone, 438,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section baseline
no_agent (1.448 ms) : 1437, 1459
. : milestone, 1448,
appsec (2.213 ms) : 2178, 2248
. : milestone, 2213,
iast (1.981 ms) : 1937, 2025
. : milestone, 1981,
iast_GLOBAL (2.015 ms) : 1971, 2059
. : milestone, 2015,
profiling (1.851 ms) : 1815, 1887
. : milestone, 1851,
tracing (1.828 ms) : 1796, 1861
. : milestone, 1828,
section candidate
no_agent (1.45 ms) : 1439, 1462
. : milestone, 1450,
appsec (2.207 ms) : 2172, 2241
. : milestone, 2207,
iast (1.953 ms) : 1911, 1995
. : milestone, 1953,
iast_GLOBAL (2.009 ms) : 1965, 2052
. : milestone, 2009,
profiling (1.857 ms) : 1822, 1893
. : milestone, 1857,
tracing (1.822 ms) : 1790, 1855
. : milestone, 1822,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.39.0-SNAPSHOT~0ab8bc2859, baseline=1.39.0-SNAPSHOT~546f7971df
dateFormat X
axisFormat %s
section baseline
no_agent (14.986 s) : 14986000, 14986000
. : milestone, 14986000,
appsec (14.938 s) : 14938000, 14938000
. : milestone, 14938000,
iast (18.684 s) : 18684000, 18684000
. : milestone, 18684000,
iast_GLOBAL (17.959 s) : 17959000, 17959000
. : milestone, 17959000,
profiling (14.857 s) : 14857000, 14857000
. : milestone, 14857000,
tracing (15.221 s) : 15221000, 15221000
. : milestone, 15221000,
section candidate
no_agent (14.834 s) : 14834000, 14834000
. : milestone, 14834000,
appsec (15.066 s) : 15066000, 15066000
. : milestone, 15066000,
iast (18.85 s) : 18850000, 18850000
. : milestone, 18850000,
iast_GLOBAL (17.947 s) : 17947000, 17947000
. : milestone, 17947000,
profiling (14.792 s) : 14792000, 14792000
. : milestone, 14792000,
tracing (15.096 s) : 15096000, 15096000
. : milestone, 15096000,
|
SymbolSink was emitting an upload requests for every scope added into the sink queue. As the queue was 1024 entries in capacity we could easily end up in a situation where more than 20 requests are made when draining the Q. to avoid that we are batching the scope together in a single larger upload request and ensure that the sink queue is flushed when full before adding new element and not losing any symbols.
13847ca to
879253c
Compare
|
|
||
| public boolean addScope(Scope jarScope) { | ||
| public void addScope(Scope jarScope) { | ||
| ServiceVersion serviceVersion = |
There was a problem hiding this comment.
not sure why we create ServiceVersion here and then break it down into scopes in flush to only build a ServiceVersion again with all the scopes. maybe we should store Scope instead?
There was a problem hiding this comment.
true it's useless, removed
| } catch (Exception e) { | ||
| ExceptionHelper.logException(LOGGER, e, "Error during scope serialization:"); | ||
| } | ||
| allScopes.addAll(serviceVersion.getScopes()); |
There was a problem hiding this comment.
nit: add classCount += serviceVersion.getScopes().get(0).getScopes().size() here and avoid the updateStat function below?
Even better, if we just keep everything as jarScope, maybe we add method getScopesCount() and make the code more readable.
There was a problem hiding this comment.
removing ServiceVersion make it simpler.
simplify by adding the getScopeCount method, but updateStats method stays
| int retries = 10; | ||
| while (!added) { | ||
| // Q is full, flushing synchronously | ||
| flush(); |
There was a problem hiding this comment.
I think this is interesting... and might cause a problem, but I'm not sure.
The way I understand the logic here:
- the symbol transformer is get called. with the class byte buffer.
- symbol Aggregator then parse it and generate scopes.
- then it ofer it to the sync, which until now was async.
- the transformer return the original bytes.
With this change, the transformer will not return until the queue is flashed, which is blocking the class from been loaded. so, In case of network delay or problems - would that cause the application to freeze?
if we go back to async mode - not sure how we dropped messages as well.
There was a problem hiding this comment.
the flush make upload http requests, but http requests are sent async in OkHttp component.
| List<ServiceVersion> scopesToSerialize = new ArrayList<>(); | ||
| // ArrayBlockingQueue makes drainTo atomic, so it is safe to call flush from different and | ||
| // concurrent threads | ||
| scopes.drainTo(scopesToSerialize); |
There was a problem hiding this comment.
maybe we should check scopesToSerialize is empty just return
ojung
left a comment
There was a problem hiding this comment.
The way I understand these changes, we could still end up with more than 20 concurrent requests: When there are (20 + 1) * 1024 classes loaded at roughly the same time. Please correct me if I'm wrong or this isn't a concern.
| return scopes.offer(serviceVersion); | ||
| public void addScope(Scope jarScope) { | ||
| boolean added = scopes.offer(jarScope); | ||
| int retries = 10; |
There was a problem hiding this comment.
Why might we need to retry more than once if flush() is synchronous?
There was a problem hiding this comment.
concurrency at the best: this flushing process is in background thread, and still (but unlikely) threads are loading a lot of classes/jars and we filling up again the Q while flushing the previous batch, we are trying again to flush.
Flush is synchronous, but we are still allowing to add to the queue once drained.
That's almost true, except that top level scopes are aggregated by jar name, en so each entry in the Queue is a different jar. So you need (20+1) *1024 different jars for that :) |
What Does This Do
SymbolSink was emitting an upload requests for every scope added into the sink queue. As the queue was 1024 entries in capacity we could easily end up in a situation where more than 20 requests are made when draining the Q. to avoid that we are batching the scope together in a single larger upload request and ensure that the sink queue is flushed when full before adding new element and not losing any symbols.
Motivation
avoid dropping SymDB requests
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any usefull labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: DEBUG-2685