-
Notifications
You must be signed in to change notification settings - Fork 311
Move JSON generation to sender thread to improve startup time. #9197
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
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 49 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.038 s) : 0, 1038001
Total [baseline] (8.615 s) : 0, 8615368
Agent [candidate] (1.039 s) : 0, 1038858
Total [candidate] (8.637 s) : 0, 8637324
section iast
Agent [baseline] (1.174 s) : 0, 1173955
Total [baseline] (9.279 s) : 0, 9279009
Agent [candidate] (1.179 s) : 0, 1179099
Total [candidate] (9.286 s) : 0, 9286186
gantt
title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.435 ms) : 0, 1435
crashtracking [candidate] (1.43 ms) : 0, 1430
BytebuddyAgent [baseline] (729.181 ms) : 0, 729181
BytebuddyAgent [candidate] (729.296 ms) : 0, 729296
GlobalTracer [baseline] (241.084 ms) : 0, 241084
GlobalTracer [candidate] (241.965 ms) : 0, 241965
AppSec [baseline] (30.441 ms) : 0, 30441
AppSec [candidate] (30.309 ms) : 0, 30309
Debugger [baseline] (6.007 ms) : 0, 6007
Debugger [candidate] (5.999 ms) : 0, 5999
Remote Config [baseline] (648.291 µs) : 0, 648
Remote Config [candidate] (641.249 µs) : 0, 641
Telemetry [baseline] (8.216 ms) : 0, 8216
Telemetry [candidate] (8.235 ms) : 0, 8235
section iast
crashtracking [baseline] (1.441 ms) : 0, 1441
crashtracking [candidate] (1.446 ms) : 0, 1446
BytebuddyAgent [baseline] (848.301 ms) : 0, 848301
BytebuddyAgent [candidate] (852.959 ms) : 0, 852959
GlobalTracer [baseline] (231.077 ms) : 0, 231077
GlobalTracer [candidate] (231.296 ms) : 0, 231296
IAST [baseline] (31.48 ms) : 0, 31480
IAST [candidate] (29.926 ms) : 0, 29926
AppSec [baseline] (25.665 ms) : 0, 25665
AppSec [candidate] (27.292 ms) : 0, 27292
Debugger [baseline] (6.61 ms) : 0, 6610
Debugger [candidate] (6.627 ms) : 0, 6627
Remote Config [baseline] (589.402 µs) : 0, 589
Remote Config [candidate] (585.728 µs) : 0, 586
Telemetry [baseline] (7.808 ms) : 0, 7808
Telemetry [candidate] (7.972 ms) : 0, 7972
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1044757
Total [baseline] (10.745 s) : 0, 10744743
Agent [candidate] (1.037 s) : 0, 1037151
Total [candidate] (10.721 s) : 0, 10720682
section appsec
Agent [baseline] (1.228 s) : 0, 1227799
Total [baseline] (10.824 s) : 0, 10824118
Agent [candidate] (1.222 s) : 0, 1222494
Total [candidate] (10.749 s) : 0, 10749396
section iast
Agent [baseline] (1.18 s) : 0, 1180112
Total [baseline] (10.919 s) : 0, 10918878
Agent [candidate] (1.17 s) : 0, 1170451
Total [candidate] (10.876 s) : 0, 10875767
section profiling
Agent [baseline] (1.191 s) : 0, 1191290
Total [baseline] (10.821 s) : 0, 10821410
Agent [candidate] (1.193 s) : 0, 1192713
Total [candidate] (10.885 s) : 0, 10885146
gantt
title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.444 ms) : 0, 1444
crashtracking [candidate] (1.427 ms) : 0, 1427
BytebuddyAgent [baseline] (735.158 ms) : 0, 735158
BytebuddyAgent [candidate] (728.337 ms) : 0, 728337
GlobalTracer [baseline] (241.502 ms) : 0, 241502
GlobalTracer [candidate] (241.154 ms) : 0, 241154
AppSec [baseline] (30.563 ms) : 0, 30563
AppSec [candidate] (30.384 ms) : 0, 30384
Debugger [baseline] (6.046 ms) : 0, 6046
Debugger [candidate] (6.025 ms) : 0, 6025
Remote Config [baseline] (650.432 µs) : 0, 650
Remote Config [candidate] (643.191 µs) : 0, 643
Telemetry [baseline] (8.257 ms) : 0, 8257
Telemetry [candidate] (8.204 ms) : 0, 8204
section appsec
crashtracking [baseline] (1.453 ms) : 0, 1453
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (758.103 ms) : 0, 758103
BytebuddyAgent [candidate] (754.732 ms) : 0, 754732
GlobalTracer [baseline] (236.185 ms) : 0, 236185
GlobalTracer [candidate] (235.422 ms) : 0, 235422
IAST [baseline] (23.895 ms) : 0, 23895
IAST [candidate] (23.795 ms) : 0, 23795
AppSec [baseline] (169.812 ms) : 0, 169812
AppSec [candidate] (170.655 ms) : 0, 170655
Debugger [baseline] (8.012 ms) : 0, 8012
Debugger [candidate] (5.621 ms) : 0, 5621
Remote Config [baseline] (617.834 µs) : 0, 618
Remote Config [candidate] (602.821 µs) : 0, 603
Telemetry [baseline] (8.283 ms) : 0, 8283
Telemetry [candidate] (8.869 ms) : 0, 8869
section iast
crashtracking [baseline] (1.436 ms) : 0, 1436
crashtracking [candidate] (1.426 ms) : 0, 1426
BytebuddyAgent [baseline] (852.3 ms) : 0, 852300
BytebuddyAgent [candidate] (844.574 ms) : 0, 844574
GlobalTracer [baseline] (232.5 ms) : 0, 232500
GlobalTracer [candidate] (231.084 ms) : 0, 231084
IAST [baseline] (29.946 ms) : 0, 29946
IAST [candidate] (28.482 ms) : 0, 28482
AppSec [baseline] (27.599 ms) : 0, 27599
AppSec [candidate] (28.003 ms) : 0, 28003
Debugger [baseline] (6.712 ms) : 0, 6712
Debugger [candidate] (7.496 ms) : 0, 7496
Remote Config [baseline] (610.727 µs) : 0, 611
Remote Config [candidate] (584.983 µs) : 0, 585
Telemetry [baseline] (7.942 ms) : 0, 7942
Telemetry [candidate] (7.923 ms) : 0, 7923
section profiling
crashtracking [baseline] (1.408 ms) : 0, 1408
crashtracking [candidate] (1.405 ms) : 0, 1405
BytebuddyAgent [baseline] (763.978 ms) : 0, 763978
BytebuddyAgent [candidate] (764.495 ms) : 0, 764495
GlobalTracer [baseline] (221.955 ms) : 0, 221955
GlobalTracer [candidate] (221.763 ms) : 0, 221763
AppSec [baseline] (30.394 ms) : 0, 30394
AppSec [candidate] (30.502 ms) : 0, 30502
Debugger [baseline] (6.319 ms) : 0, 6319
Debugger [candidate] (6.348 ms) : 0, 6348
Remote Config [baseline] (695.312 µs) : 0, 695
Remote Config [candidate] (673.091 µs) : 0, 673
Telemetry [baseline] (12.619 ms) : 0, 12619
Telemetry [candidate] (11.887 ms) : 0, 11887
ProfilingAgent [baseline] (105.219 ms) : 0, 105219
ProfilingAgent [candidate] (106.811 ms) : 0, 106811
Profiling [baseline] (105.242 ms) : 0, 105242
Profiling [candidate] (106.835 ms) : 0, 106835
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 10 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section baseline
no_agent (36.963 ms) : 36666, 37261
. : milestone, 36963,
appsec (48.03 ms) : 47605, 48454
. : milestone, 48030,
code_origins (45.098 ms) : 44700, 45497
. : milestone, 45098,
iast (45.605 ms) : 45205, 46005
. : milestone, 45605,
profiling (49.131 ms) : 48683, 49579
. : milestone, 49131,
tracing (44.554 ms) : 44170, 44939
. : milestone, 44554,
section candidate
no_agent (38.32 ms) : 38013, 38627
. : milestone, 38320,
appsec (47.859 ms) : 47443, 48275
. : milestone, 47859,
code_origins (44.659 ms) : 44258, 45059
. : milestone, 44659,
iast (45.288 ms) : 44899, 45678
. : milestone, 45288,
profiling (49.358 ms) : 48918, 49798
. : milestone, 49358,
tracing (44.954 ms) : 44590, 45318
. : milestone, 44954,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section baseline
no_agent (4.303 ms) : 4254, 4351
. : milestone, 4303,
iast (9.182 ms) : 9033, 9331
. : milestone, 9182,
iast_FULL (14.052 ms) : 13772, 14333
. : milestone, 14052,
iast_GLOBAL (9.995 ms) : 9808, 10181
. : milestone, 9995,
profiling (8.814 ms) : 8672, 8955
. : milestone, 8814,
tracing (7.535 ms) : 7420, 7649
. : milestone, 7535,
section candidate
no_agent (4.162 ms) : 4108, 4215
. : milestone, 4162,
iast (9.551 ms) : 9393, 9710
. : milestone, 9551,
iast_FULL (14.157 ms) : 13877, 14438
. : milestone, 14157,
iast_GLOBAL (10.256 ms) : 10073, 10439
. : milestone, 10256,
profiling (8.836 ms) : 8691, 8981
. : milestone, 8836,
tracing (7.468 ms) : 7358, 7578
. : milestone, 7468,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section baseline
no_agent (15.079 s) : 15079000, 15079000
. : milestone, 15079000,
appsec (14.809 s) : 14809000, 14809000
. : milestone, 14809000,
iast (18.296 s) : 18296000, 18296000
. : milestone, 18296000,
iast_GLOBAL (18.321 s) : 18321000, 18321000
. : milestone, 18321000,
profiling (15.31 s) : 15310000, 15310000
. : milestone, 15310000,
tracing (14.871 s) : 14871000, 14871000
. : milestone, 14871000,
section candidate
no_agent (15.285 s) : 15285000, 15285000
. : milestone, 15285000,
appsec (14.796 s) : 14796000, 14796000
. : milestone, 14796000,
iast (18.624 s) : 18624000, 18624000
. : milestone, 18624000,
iast_GLOBAL (17.833 s) : 17833000, 17833000
. : milestone, 17833000,
profiling (15.427 s) : 15427000, 15427000
. : milestone, 15427000,
tracing (14.805 s) : 14805000, 14805000
. : milestone, 14805000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~7dc3e05f7a, baseline=1.52.0-SNAPSHOT~e82c8b5e17
dateFormat X
axisFormat %s
section baseline
no_agent (1.485 ms) : 1474, 1497
. : milestone, 1485,
appsec (3.674 ms) : 3455, 3892
. : milestone, 3674,
iast (2.213 ms) : 2150, 2275
. : milestone, 2213,
iast_GLOBAL (2.264 ms) : 2200, 2327
. : milestone, 2264,
profiling (2.055 ms) : 2004, 2105
. : milestone, 2055,
tracing (2.027 ms) : 1978, 2075
. : milestone, 2027,
section candidate
no_agent (1.489 ms) : 1477, 1501
. : milestone, 1489,
appsec (3.618 ms) : 3404, 3831
. : milestone, 3618,
iast (2.212 ms) : 2149, 2275
. : milestone, 2212,
iast_GLOBAL (2.258 ms) : 2195, 2321
. : milestone, 2258,
profiling (2.041 ms) : 1991, 2091
. : milestone, 2041,
tracing (2.025 ms) : 1977, 2074
. : milestone, 2025,
|
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.
Good improvement idea!
I left minor comments. I also wonder if we should start creating a dedicated class for meta
and points
and enjoy it to create a dedicated setResult()
and toJson()
method.
this.points = new LinkedHashMap<>(); | ||
|
||
setMetaInfo("success", "success", "Successfully configured ddtrace package"); |
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.
Interesting improvement about storing result state in directly in meta rather using duplicate flag.
nitpick: Renaming setMetaInfo
to setResultMeta
would help to understand readers that result will be overridden later on error.
} | ||
|
||
private void onPoint(String name, List<String> tags) { | ||
private void onPoint(String name, String... tags) { |
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.
Not sure what's best here 🤷
Varargs will create an implicit array, that Arrays.asList
will project as list. While the original code only do projection using Collections.singletonList()
without allocating an array for single value.
That's minimal change, not in the hot path. One thing I wonder if we use varargs, we might update meta
to List<String, String[]>
to avoid projecting as list. But in the meantime, you now have to convert causes
from List<String> to
String[](that later then wrapped with
Arrays.asList()` 🤔
Yes, I have the same feeling. Will work on this idea. |
What Does This Do
Move JSON generation to sender thread to improve startup time.
Motivation
Improve agent startup time by offloading JSON generation to separate thread.