-
Notifications
You must be signed in to change notification settings - Fork 324
Refactor SMAP parser #10385
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
Refactor SMAP parser #10385
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 59 metrics, 6 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.098 s) : 0, 1098369
Total [baseline] (10.771 s) : 0, 10770587
Agent [candidate] (1.095 s) : 0, 1094946
Total [candidate] (10.804 s) : 0, 10804265
section appsec
Agent [baseline] (1.262 s) : 0, 1262369
Total [baseline] (10.987 s) : 0, 10986990
Agent [candidate] (1.272 s) : 0, 1272139
Total [candidate] (11.03 s) : 0, 11030053
section iast
Agent [baseline] (1.232 s) : 0, 1231693
Total [baseline] (11.145 s) : 0, 11145386
Agent [candidate] (1.224 s) : 0, 1223971
Total [candidate] (11.25 s) : 0, 11250033
section profiling
Agent [baseline] (1.212 s) : 0, 1212058
Total [baseline] (10.879 s) : 0, 10879241
Agent [candidate] (1.213 s) : 0, 1212738
Total [candidate] (10.886 s) : 0, 10886276
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.202 ms) : 0, 1202
crashtracking [candidate] (1.18 ms) : 0, 1180
BytebuddyAgent [baseline] (660.271 ms) : 0, 660271
BytebuddyAgent [candidate] (657.409 ms) : 0, 657409
GlobalTracer [baseline] (285.833 ms) : 0, 285833
GlobalTracer [candidate] (285.879 ms) : 0, 285879
AppSec [baseline] (33.293 ms) : 0, 33293
AppSec [candidate] (33.041 ms) : 0, 33041
Debugger [baseline] (68.41 ms) : 0, 68410
Debugger [candidate] (68.443 ms) : 0, 68443
Remote Config [baseline] (655.648 µs) : 0, 656
Remote Config [candidate] (627.279 µs) : 0, 627
Telemetry [baseline] (9.038 ms) : 0, 9038
Telemetry [candidate] (8.965 ms) : 0, 8965
Flare Poller [baseline] (3.87 ms) : 0, 3870
Flare Poller [candidate] (3.829 ms) : 0, 3829
section appsec
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (689.494 ms) : 0, 689494
BytebuddyAgent [candidate] (696.092 ms) : 0, 696092
GlobalTracer [baseline] (257.856 ms) : 0, 257856
GlobalTracer [candidate] (259.973 ms) : 0, 259973
IAST [baseline] (24.64 ms) : 0, 24640
IAST [candidate] (24.749 ms) : 0, 24749
AppSec [baseline] (170.956 ms) : 0, 170956
AppSec [candidate] (173.593 ms) : 0, 173593
Debugger [baseline] (68.993 ms) : 0, 68993
Debugger [candidate] (67.244 ms) : 0, 67244
Remote Config [baseline] (752.545 µs) : 0, 753
Remote Config [candidate] (737.06 µs) : 0, 737
Telemetry [baseline] (9.396 ms) : 0, 9396
Telemetry [candidate] (9.254 ms) : 0, 9254
Flare Poller [baseline] (3.796 ms) : 0, 3796
Flare Poller [candidate] (3.78 ms) : 0, 3780
section iast
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.189 ms) : 0, 1189
BytebuddyAgent [baseline] (796.82 ms) : 0, 796820
BytebuddyAgent [candidate] (791.953 ms) : 0, 791953
GlobalTracer [baseline] (258.178 ms) : 0, 258178
GlobalTracer [candidate] (256.037 ms) : 0, 256037
IAST [baseline] (27.219 ms) : 0, 27219
IAST [candidate] (26.873 ms) : 0, 26873
AppSec [baseline] (33.495 ms) : 0, 33495
AppSec [candidate] (34.944 ms) : 0, 34944
Debugger [baseline] (66.777 ms) : 0, 66777
Debugger [candidate] (65.041 ms) : 0, 65041
Remote Config [baseline] (573.123 µs) : 0, 573
Remote Config [candidate] (585.228 µs) : 0, 585
Telemetry [baseline] (8.463 ms) : 0, 8463
Telemetry [candidate] (8.461 ms) : 0, 8461
Flare Poller [baseline] (3.522 ms) : 0, 3522
Flare Poller [candidate] (3.581 ms) : 0, 3581
section profiling
crashtracking [baseline] (1.214 ms) : 0, 1214
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (706.309 ms) : 0, 706309
BytebuddyAgent [candidate] (707.77 ms) : 0, 707770
GlobalTracer [baseline] (222.118 ms) : 0, 222118
GlobalTracer [candidate] (222.666 ms) : 0, 222666
AppSec [baseline] (32.811 ms) : 0, 32811
AppSec [candidate] (32.511 ms) : 0, 32511
Debugger [baseline] (69.003 ms) : 0, 69003
Debugger [candidate] (68.364 ms) : 0, 68364
Remote Config [baseline] (645.036 µs) : 0, 645
Remote Config [candidate] (611.85 µs) : 0, 612
Telemetry [baseline] (9.026 ms) : 0, 9026
Telemetry [candidate] (8.931 ms) : 0, 8931
Flare Poller [baseline] (3.749 ms) : 0, 3749
Flare Poller [candidate] (4.437 ms) : 0, 4437
ProfilingAgent [baseline] (97.064 ms) : 0, 97064
ProfilingAgent [candidate] (96.007 ms) : 0, 96007
Profiling [baseline] (97.65 ms) : 0, 97650
Profiling [candidate] (96.582 ms) : 0, 96582
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.101 s) : 0, 1100510
Total [baseline] (8.749 s) : 0, 8748986
Agent [candidate] (1.098 s) : 0, 1098269
Total [candidate] (8.792 s) : 0, 8792055
section iast
Agent [baseline] (1.22 s) : 0, 1220176
Total [baseline] (9.337 s) : 0, 9336995
Agent [candidate] (1.232 s) : 0, 1232353
Total [candidate] (9.332 s) : 0, 9332199
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (663.037 ms) : 0, 663037
BytebuddyAgent [candidate] (660.708 ms) : 0, 660708
GlobalTracer [baseline] (285.773 ms) : 0, 285773
GlobalTracer [candidate] (286.22 ms) : 0, 286220
AppSec [baseline] (33.244 ms) : 0, 33244
AppSec [candidate] (33.074 ms) : 0, 33074
Debugger [baseline] (67.827 ms) : 0, 67827
Debugger [candidate] (67.677 ms) : 0, 67677
Remote Config [baseline] (646.078 µs) : 0, 646
Remote Config [candidate] (633.242 µs) : 0, 633
Telemetry [baseline] (9.051 ms) : 0, 9051
Telemetry [candidate] (9.025 ms) : 0, 9025
Flare Poller [baseline] (3.834 ms) : 0, 3834
Flare Poller [candidate] (3.814 ms) : 0, 3814
section iast
crashtracking [baseline] (1.18 ms) : 0, 1180
crashtracking [candidate] (1.192 ms) : 0, 1192
BytebuddyAgent [baseline] (789.36 ms) : 0, 789360
BytebuddyAgent [candidate] (799.349 ms) : 0, 799349
GlobalTracer [baseline] (255.616 ms) : 0, 255616
GlobalTracer [candidate] (257.649 ms) : 0, 257649
IAST [baseline] (26.93 ms) : 0, 26930
IAST [candidate] (27.097 ms) : 0, 27097
AppSec [baseline] (35.316 ms) : 0, 35316
AppSec [candidate] (34.362 ms) : 0, 34362
Debugger [baseline] (63.786 ms) : 0, 63786
Debugger [candidate] (64.576 ms) : 0, 64576
Remote Config [baseline] (571.748 µs) : 0, 572
Remote Config [candidate] (586.045 µs) : 0, 586
Telemetry [baseline] (8.541 ms) : 0, 8541
Telemetry [candidate] (8.394 ms) : 0, 8394
Flare Poller [baseline] (3.616 ms) : 0, 3616
Flare Poller [candidate] (3.611 ms) : 0, 3611
LoadParameters
See matching parameters
SummaryFound 4 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section baseline
no_agent (1.164 ms) : 1153, 1175
. : milestone, 1164,
iast (3.339 ms) : 3293, 3385
. : milestone, 3339,
iast_FULL (5.878 ms) : 5820, 5937
. : milestone, 5878,
iast_GLOBAL (3.647 ms) : 3600, 3695
. : milestone, 3647,
profiling (2.09 ms) : 2071, 2109
. : milestone, 2090,
tracing (1.789 ms) : 1773, 1805
. : milestone, 1789,
section candidate
no_agent (1.224 ms) : 1212, 1235
. : milestone, 1224,
iast (3.164 ms) : 3119, 3209
. : milestone, 3164,
iast_FULL (5.846 ms) : 5788, 5904
. : milestone, 5846,
iast_GLOBAL (3.437 ms) : 3388, 3487
. : milestone, 3437,
profiling (2.145 ms) : 2124, 2166
. : milestone, 2145,
tracing (1.806 ms) : 1791, 1822
. : milestone, 1806,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section baseline
no_agent (19.005 ms) : 18811, 19199
. : milestone, 19005,
appsec (19.705 ms) : 19505, 19904
. : milestone, 19705,
code_origins (18.697 ms) : 18509, 18885
. : milestone, 18697,
iast (17.787 ms) : 17609, 17965
. : milestone, 17787,
profiling (19.145 ms) : 18952, 19337
. : milestone, 19145,
tracing (17.994 ms) : 17818, 18170
. : milestone, 17994,
section candidate
no_agent (19.038 ms) : 18842, 19233
. : milestone, 19038,
appsec (18.99 ms) : 18798, 19182
. : milestone, 18990,
code_origins (18.034 ms) : 17853, 18215
. : milestone, 18034,
iast (17.997 ms) : 17818, 18177
. : milestone, 17997,
profiling (19.035 ms) : 18844, 19226
. : milestone, 19035,
tracing (17.668 ms) : 17492, 17845
. : milestone, 17668,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1492
. : milestone, 1480,
appsec (3.738 ms) : 3517, 3960
. : milestone, 3738,
iast (2.229 ms) : 2163, 2294
. : milestone, 2229,
iast_GLOBAL (2.269 ms) : 2203, 2335
. : milestone, 2269,
profiling (2.109 ms) : 2054, 2164
. : milestone, 2109,
tracing (2.056 ms) : 2005, 2108
. : milestone, 2056,
section candidate
no_agent (1.481 ms) : 1469, 1492
. : milestone, 1481,
appsec (3.732 ms) : 3509, 3954
. : milestone, 3732,
iast (2.234 ms) : 2168, 2300
. : milestone, 2234,
iast_GLOBAL (2.271 ms) : 2205, 2336
. : milestone, 2271,
profiling (2.5 ms) : 2337, 2663
. : milestone, 2500,
tracing (2.068 ms) : 2016, 2120
. : milestone, 2068,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~054089ce96, baseline=1.59.0-SNAPSHOT~34b16160f8
dateFormat X
axisFormat %s
section baseline
no_agent (15.585 s) : 15585000, 15585000
. : milestone, 15585000,
appsec (14.92 s) : 14920000, 14920000
. : milestone, 14920000,
iast (17.775 s) : 17775000, 17775000
. : milestone, 17775000,
iast_GLOBAL (18.137 s) : 18137000, 18137000
. : milestone, 18137000,
profiling (14.884 s) : 14884000, 14884000
. : milestone, 14884000,
tracing (14.834 s) : 14834000, 14834000
. : milestone, 14834000,
section candidate
no_agent (14.929 s) : 14929000, 14929000
. : milestone, 14929000,
appsec (14.751 s) : 14751000, 14751000
. : milestone, 14751000,
iast (18.17 s) : 18170000, 18170000
. : milestone, 18170000,
iast_GLOBAL (17.85 s) : 17850000, 17850000
. : milestone, 17850000,
profiling (15.124 s) : 15124000, 15124000
. : milestone, 15124000,
tracing (14.767 s) : 14767000, 14767000
. : milestone, 14767000,
|
bric3
left a comment
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.
Cool !
...va-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/stratum/StratumManager.java
Outdated
Show resolved
Hide resolved
...va-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/stratum/StratumManager.java
Outdated
Show resolved
Hide resolved
...va-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/stratum/StratumManager.java
Outdated
Show resolved
Hide resolved
Groovy... |
| public static StratumManager init(int sourceMappingLimit, IntConsumer limitReachedCallback) { | ||
| INSTANCE = new StratumManager(sourceMappingLimit, limitReachedCallback); | ||
| return INSTANCE; | ||
| } |
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.
note: This is weird, but as discussed IRL, this is enough for now.
| import java.util.regex.Pattern; | ||
|
|
||
| public class Parser { | ||
| private static final Pattern END_OF_LINE_PATTERN = Pattern.compile("\n"); |
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 wondering if this works for all OS as they use different line ending (CR, LF y CRLF)
Maybe we can use Pattern.compile("\\r?\\n|\\r") or something similar
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 catch!
I have modified the pattern
jandro996
left a comment
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.
LGtM! just a comment in the Parser
2db0877 to
616b864
Compare
Simplify code, reduce allocations remove checked exceptions use an enum for builders
616b864 to
054089c
Compare
Simplify code, reduce allocations remove checked exceptions use an enum for builders Remove dependency to IAST with StratumManager
What Does This Do
Simplify code, reduce allocations
remove checked exceptions
use an enum for builders
move packages
Motivation
Reuse for Kotlin classes
Additional Notes
Related to
Note
There is no difference in the SMAP syntax between JSR 45 and Jakarta Debugging Support for Other Languages 2.0. The technical specification (grammar, sections, format) is identical.
Version History
javax.*tojakarta.*for Jakarta EE 9What Changed
javax.*→jakarta.*) as part of Jakarta EE 9.SMAP Syntax
The SMAP grammar remains unchanged across all versions:
StratumSection,FileSection,LineSection,VendorSection,EmbeddedSourceMaps— all identical.References
Contributor Checklist
type:and (comp:orinst:) labels in addition to any useful labelsclose,fixor any linking keywords when referencing an issue.Use
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]