-
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
base: master
Are you sure you want to change the base?
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 57 metrics, 8 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.091 s) : 0, 1090902
Total [baseline] (10.836 s) : 0, 10836055
Agent [candidate] (1.088 s) : 0, 1087579
Total [candidate] (10.815 s) : 0, 10815245
section appsec
Agent [baseline] (1.276 s) : 0, 1275839
Total [baseline] (11.094 s) : 0, 11093752
Agent [candidate] (1.271 s) : 0, 1270796
Total [candidate] (11.087 s) : 0, 11087024
section iast
Agent [baseline] (1.231 s) : 0, 1231027
Total [baseline] (11.177 s) : 0, 11176775
Agent [candidate] (1.235 s) : 0, 1234664
Total [candidate] (11.239 s) : 0, 11239429
section profiling
Agent [baseline] (1.207 s) : 0, 1207161
Total [baseline] (10.932 s) : 0, 10932423
Agent [candidate] (1.223 s) : 0, 1222882
Total [candidate] (11.009 s) : 0, 11008828
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (655.645 ms) : 0, 655645
BytebuddyAgent [candidate] (653.806 ms) : 0, 653806
GlobalTracer [baseline] (283.411 ms) : 0, 283411
GlobalTracer [candidate] (283.605 ms) : 0, 283605
AppSec [baseline] (32.862 ms) : 0, 32862
AppSec [candidate] (32.485 ms) : 0, 32485
Debugger [baseline] (68.265 ms) : 0, 68265
Debugger [candidate] (67.386 ms) : 0, 67386
Remote Config [baseline] (650.616 µs) : 0, 651
Remote Config [candidate] (626.967 µs) : 0, 627
Telemetry [baseline] (9.119 ms) : 0, 9119
Telemetry [candidate] (9.005 ms) : 0, 9005
Flare Poller [baseline] (3.846 ms) : 0, 3846
Flare Poller [candidate] (3.814 ms) : 0, 3814
section appsec
crashtracking [baseline] (1.209 ms) : 0, 1209
crashtracking [candidate] (1.19 ms) : 0, 1190
BytebuddyAgent [baseline] (698.098 ms) : 0, 698098
BytebuddyAgent [candidate] (696.006 ms) : 0, 696006
GlobalTracer [baseline] (260.789 ms) : 0, 260789
GlobalTracer [candidate] (259.644 ms) : 0, 259644
AppSec [baseline] (174.28 ms) : 0, 174280
AppSec [candidate] (173.755 ms) : 0, 173755
Debugger [baseline] (67.002 ms) : 0, 67002
Debugger [candidate] (66.268 ms) : 0, 66268
Remote Config [baseline] (767.939 µs) : 0, 768
Remote Config [candidate] (737.571 µs) : 0, 738
Telemetry [baseline] (9.295 ms) : 0, 9295
Telemetry [candidate] (9.304 ms) : 0, 9304
Flare Poller [baseline] (3.793 ms) : 0, 3793
Flare Poller [candidate] (3.658 ms) : 0, 3658
IAST [baseline] (24.973 ms) : 0, 24973
IAST [candidate] (24.66 ms) : 0, 24660
section iast
crashtracking [baseline] (1.191 ms) : 0, 1191
crashtracking [candidate] (1.182 ms) : 0, 1182
BytebuddyAgent [baseline] (795.741 ms) : 0, 795741
BytebuddyAgent [candidate] (797.031 ms) : 0, 797031
GlobalTracer [baseline] (257.926 ms) : 0, 257926
GlobalTracer [candidate] (258.694 ms) : 0, 258694
AppSec [baseline] (34.778 ms) : 0, 34778
AppSec [candidate] (34.025 ms) : 0, 34025
Debugger [baseline] (65.871 ms) : 0, 65871
Debugger [candidate] (67.759 ms) : 0, 67759
Remote Config [baseline] (602.079 µs) : 0, 602
Remote Config [candidate] (595.758 µs) : 0, 596
Telemetry [baseline] (8.614 ms) : 0, 8614
Telemetry [candidate] (8.682 ms) : 0, 8682
Flare Poller [baseline] (3.6 ms) : 0, 3600
Flare Poller [candidate] (3.62 ms) : 0, 3620
IAST [baseline] (27.215 ms) : 0, 27215
IAST [candidate] (27.422 ms) : 0, 27422
section profiling
crashtracking [baseline] (1.218 ms) : 0, 1218
crashtracking [candidate] (1.237 ms) : 0, 1237
BytebuddyAgent [baseline] (703.313 ms) : 0, 703313
BytebuddyAgent [candidate] (712.806 ms) : 0, 712806
GlobalTracer [baseline] (221.531 ms) : 0, 221531
GlobalTracer [candidate] (224.513 ms) : 0, 224513
AppSec [baseline] (32.021 ms) : 0, 32021
AppSec [candidate] (32.73 ms) : 0, 32730
Debugger [baseline] (67.951 ms) : 0, 67951
Debugger [candidate] (68.766 ms) : 0, 68766
Remote Config [baseline] (632.501 µs) : 0, 633
Remote Config [candidate] (636.18 µs) : 0, 636
Telemetry [baseline] (8.94 ms) : 0, 8940
Telemetry [candidate] (9.006 ms) : 0, 9006
Flare Poller [baseline] (3.761 ms) : 0, 3761
Flare Poller [candidate] (3.786 ms) : 0, 3786
ProfilingAgent [baseline] (97.824 ms) : 0, 97824
ProfilingAgent [candidate] (98.574 ms) : 0, 98574
Profiling [baseline] (98.408 ms) : 0, 98408
Profiling [candidate] (99.16 ms) : 0, 99160
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.095 s) : 0, 1094850
Total [baseline] (8.806 s) : 0, 8806085
Agent [candidate] (1.087 s) : 0, 1086973
Total [candidate] (8.789 s) : 0, 8789180
section iast
Agent [baseline] (1.227 s) : 0, 1226662
Total [baseline] (9.319 s) : 0, 9318826
Agent [candidate] (1.226 s) : 0, 1226436
Total [candidate] (9.355 s) : 0, 9355233
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.198 ms) : 0, 1198
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (658.239 ms) : 0, 658239
BytebuddyAgent [candidate] (653.321 ms) : 0, 653321
GlobalTracer [baseline] (285.316 ms) : 0, 285316
GlobalTracer [candidate] (283.58 ms) : 0, 283580
AppSec [baseline] (32.927 ms) : 0, 32927
AppSec [candidate] (32.694 ms) : 0, 32694
Debugger [baseline] (67.787 ms) : 0, 67787
Debugger [candidate] (67.125 ms) : 0, 67125
Remote Config [baseline] (658.684 µs) : 0, 659
Remote Config [candidate] (637.942 µs) : 0, 638
Telemetry [baseline] (9.033 ms) : 0, 9033
Telemetry [candidate] (9.073 ms) : 0, 9073
Flare Poller [baseline] (3.817 ms) : 0, 3817
Flare Poller [candidate] (3.815 ms) : 0, 3815
section iast
crashtracking [baseline] (1.183 ms) : 0, 1183
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (793.767 ms) : 0, 793767
BytebuddyAgent [candidate] (794.344 ms) : 0, 794344
GlobalTracer [baseline] (257.43 ms) : 0, 257430
GlobalTracer [candidate] (256.811 ms) : 0, 256811
AppSec [baseline] (33.499 ms) : 0, 33499
AppSec [candidate] (32.66 ms) : 0, 32660
Debugger [baseline] (65.483 ms) : 0, 65483
Debugger [candidate] (66.608 ms) : 0, 66608
Remote Config [baseline] (574.511 µs) : 0, 575
Remote Config [candidate] (549.712 µs) : 0, 550
Telemetry [baseline] (8.495 ms) : 0, 8495
Telemetry [candidate] (8.349 ms) : 0, 8349
Flare Poller [baseline] (3.566 ms) : 0, 3566
Flare Poller [candidate] (3.569 ms) : 0, 3569
IAST [baseline] (27.089 ms) : 0, 27089
IAST [candidate] (26.939 ms) : 0, 26939
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 4 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section baseline
no_agent (18.317 ms) : 18128, 18506
. : milestone, 18317,
appsec (18.521 ms) : 18334, 18708
. : milestone, 18521,
code_origins (17.771 ms) : 17592, 17951
. : milestone, 17771,
iast (17.816 ms) : 17640, 17993
. : milestone, 17816,
profiling (18.83 ms) : 18643, 19017
. : milestone, 18830,
tracing (17.597 ms) : 17426, 17769
. : milestone, 17597,
section candidate
no_agent (18.409 ms) : 18215, 18602
. : milestone, 18409,
appsec (19.666 ms) : 19468, 19864
. : milestone, 19666,
code_origins (17.646 ms) : 17471, 17821
. : milestone, 17646,
iast (17.635 ms) : 17459, 17811
. : milestone, 17635,
profiling (19.697 ms) : 19501, 19894
. : milestone, 19697,
tracing (18.19 ms) : 18009, 18371
. : milestone, 18190,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.171 ms) : 1160, 1183
. : milestone, 1171,
iast (3.206 ms) : 3166, 3246
. : milestone, 3206,
iast_FULL (5.651 ms) : 5595, 5707
. : milestone, 5651,
iast_GLOBAL (3.485 ms) : 3438, 3532
. : milestone, 3485,
profiling (2.104 ms) : 2086, 2122
. : milestone, 2104,
tracing (1.764 ms) : 1750, 1778
. : milestone, 1764,
section candidate
no_agent (1.184 ms) : 1173, 1195
. : milestone, 1184,
iast (3.187 ms) : 3147, 3226
. : milestone, 3187,
iast_FULL (5.862 ms) : 5804, 5920
. : milestone, 5862,
iast_GLOBAL (3.564 ms) : 3509, 3620
. : milestone, 3564,
profiling (1.951 ms) : 1935, 1967
. : milestone, 1951,
tracing (1.814 ms) : 1798, 1829
. : milestone, 1814,
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.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section baseline
no_agent (15.072 s) : 15072000, 15072000
. : milestone, 15072000,
appsec (14.632 s) : 14632000, 14632000
. : milestone, 14632000,
iast (18.174 s) : 18174000, 18174000
. : milestone, 18174000,
iast_GLOBAL (17.902 s) : 17902000, 17902000
. : milestone, 17902000,
profiling (14.861 s) : 14861000, 14861000
. : milestone, 14861000,
tracing (14.636 s) : 14636000, 14636000
. : milestone, 14636000,
section candidate
no_agent (15.168 s) : 15168000, 15168000
. : milestone, 15168000,
appsec (14.413 s) : 14413000, 14413000
. : milestone, 14413000,
iast (18.173 s) : 18173000, 18173000
. : milestone, 18173000,
iast_GLOBAL (17.621 s) : 17621000, 17621000
. : milestone, 17621000,
profiling (15.341 s) : 15341000, 15341000
. : milestone, 15341000,
tracing (14.881 s) : 14881000, 14881000
. : milestone, 14881000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~616b864922, baseline=1.59.0-SNAPSHOT~a08b93afcb
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1461, 1484
. : milestone, 1473,
appsec (3.659 ms) : 3443, 3874
. : milestone, 3659,
iast (2.201 ms) : 2136, 2265
. : milestone, 2201,
iast_GLOBAL (2.255 ms) : 2189, 2320
. : milestone, 2255,
profiling (2.06 ms) : 2007, 2113
. : milestone, 2060,
tracing (2.046 ms) : 1995, 2097
. : milestone, 2046,
section candidate
no_agent (1.466 ms) : 1454, 1477
. : milestone, 1466,
appsec (3.716 ms) : 3498, 3935
. : milestone, 3716,
iast (2.208 ms) : 2143, 2273
. : milestone, 2208,
iast_GLOBAL (2.245 ms) : 2180, 2310
. : milestone, 2245,
profiling (2.087 ms) : 2033, 2141
. : milestone, 2087,
tracing (2.031 ms) : 1980, 2082
. : milestone, 2031,
|
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
Simplify code, reduce allocations remove checked exceptions use an enum for builders
2db0877 to
616b864
Compare
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]