-
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
Simplify code, reduce allocations remove checked exceptions use an enum for builders
|
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 55 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1084188
Total [baseline] (8.745 s) : 0, 8744575
Agent [candidate] (1.091 s) : 0, 1090956
Total [candidate] (8.722 s) : 0, 8721578
section iast
Agent [baseline] (1.223 s) : 0, 1223025
Total [baseline] (9.274 s) : 0, 9273697
Agent [candidate] (1.23 s) : 0, 1230316
Total [candidate] (9.297 s) : 0, 9297142
gantt
title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (652.162 ms) : 0, 652162
BytebuddyAgent [candidate] (656.018 ms) : 0, 656018
GlobalTracer [baseline] (282.487 ms) : 0, 282487
GlobalTracer [candidate] (284.434 ms) : 0, 284434
AppSec [baseline] (32.614 ms) : 0, 32614
AppSec [candidate] (32.923 ms) : 0, 32923
Debugger [baseline] (66.759 ms) : 0, 66759
Debugger [candidate] (67.334 ms) : 0, 67334
Remote Config [baseline] (629.222 µs) : 0, 629
Remote Config [candidate] (636.897 µs) : 0, 637
Telemetry [baseline] (9.018 ms) : 0, 9018
Telemetry [candidate] (8.949 ms) : 0, 8949
Flare Poller [baseline] (3.791 ms) : 0, 3791
Flare Poller [candidate] (3.888 ms) : 0, 3888
section iast
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.196 ms) : 0, 1196
BytebuddyAgent [baseline] (791.488 ms) : 0, 791488
BytebuddyAgent [candidate] (798.432 ms) : 0, 798432
GlobalTracer [baseline] (256.491 ms) : 0, 256491
GlobalTracer [candidate] (257.046 ms) : 0, 257046
AppSec [baseline] (34.897 ms) : 0, 34897
AppSec [candidate] (33.528 ms) : 0, 33528
Debugger [baseline] (63.979 ms) : 0, 63979
Debugger [candidate] (65.28 ms) : 0, 65280
Remote Config [baseline] (568.795 µs) : 0, 569
Remote Config [candidate] (575.104 µs) : 0, 575
Telemetry [baseline] (8.48 ms) : 0, 8480
Telemetry [candidate] (8.373 ms) : 0, 8373
Flare Poller [baseline] (3.63 ms) : 0, 3630
Flare Poller [candidate] (3.571 ms) : 0, 3571
IAST [baseline] (26.893 ms) : 0, 26893
IAST [candidate] (26.897 ms) : 0, 26897
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.084 s) : 0, 1084341
Total [baseline] (10.755 s) : 0, 10754851
Agent [candidate] (1.086 s) : 0, 1085723
Total [candidate] (10.801 s) : 0, 10800883
section appsec
Agent [baseline] (1.265 s) : 0, 1265127
Total [baseline] (10.998 s) : 0, 10997529
Agent [candidate] (1.276 s) : 0, 1275756
Total [candidate] (11.078 s) : 0, 11078448
section iast
Agent [baseline] (1.224 s) : 0, 1223841
Total [baseline] (11.225 s) : 0, 11224727
Agent [candidate] (1.235 s) : 0, 1234725
Total [candidate] (11.306 s) : 0, 11305911
section profiling
Agent [baseline] (1.217 s) : 0, 1216629
Total [baseline] (10.907 s) : 0, 10906700
Agent [candidate] (1.218 s) : 0, 1217790
Total [candidate] (10.859 s) : 0, 10859041
gantt
title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.2 ms) : 0, 1200
crashtracking [candidate] (1.174 ms) : 0, 1174
BytebuddyAgent [baseline] (651.346 ms) : 0, 651346
BytebuddyAgent [candidate] (652.843 ms) : 0, 652843
GlobalTracer [baseline] (282.515 ms) : 0, 282515
GlobalTracer [candidate] (282.681 ms) : 0, 282681
AppSec [baseline] (32.511 ms) : 0, 32511
AppSec [candidate] (32.461 ms) : 0, 32461
Debugger [baseline] (67.949 ms) : 0, 67949
Debugger [candidate] (67.705 ms) : 0, 67705
Remote Config [baseline] (643.248 µs) : 0, 643
Remote Config [candidate] (648.634 µs) : 0, 649
Telemetry [baseline] (8.936 ms) : 0, 8936
Telemetry [candidate] (8.964 ms) : 0, 8964
Flare Poller [baseline] (3.802 ms) : 0, 3802
Flare Poller [candidate] (3.776 ms) : 0, 3776
section appsec
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.205 ms) : 0, 1205
BytebuddyAgent [baseline] (689.75 ms) : 0, 689750
BytebuddyAgent [candidate] (696.631 ms) : 0, 696631
GlobalTracer [baseline] (259.556 ms) : 0, 259556
GlobalTracer [candidate] (261.474 ms) : 0, 261474
AppSec [baseline] (174.108 ms) : 0, 174108
AppSec [candidate] (174.108 ms) : 0, 174108
Debugger [baseline] (66.637 ms) : 0, 66637
Debugger [candidate] (67.765 ms) : 0, 67765
Remote Config [baseline] (767.474 µs) : 0, 767
Remote Config [candidate] (793.929 µs) : 0, 794
Telemetry [baseline] (9.233 ms) : 0, 9233
Telemetry [candidate] (9.373 ms) : 0, 9373
Flare Poller [baseline] (3.789 ms) : 0, 3789
Flare Poller [candidate] (3.78 ms) : 0, 3780
IAST [baseline] (24.76 ms) : 0, 24760
IAST [candidate] (25.058 ms) : 0, 25058
section iast
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.185 ms) : 0, 1185
BytebuddyAgent [baseline] (791.488 ms) : 0, 791488
BytebuddyAgent [candidate] (799.506 ms) : 0, 799506
GlobalTracer [baseline] (256.489 ms) : 0, 256489
GlobalTracer [candidate] (257.784 ms) : 0, 257784
AppSec [baseline] (34.996 ms) : 0, 34996
AppSec [candidate] (33.752 ms) : 0, 33752
Debugger [baseline] (64.529 ms) : 0, 64529
Debugger [candidate] (66.984 ms) : 0, 66984
Remote Config [baseline] (563.851 µs) : 0, 564
Remote Config [candidate] (583.88 µs) : 0, 584
Telemetry [baseline] (8.443 ms) : 0, 8443
Telemetry [candidate] (8.531 ms) : 0, 8531
Flare Poller [baseline] (3.547 ms) : 0, 3547
Flare Poller [candidate] (3.621 ms) : 0, 3621
IAST [baseline] (27.086 ms) : 0, 27086
IAST [candidate] (27.278 ms) : 0, 27278
section profiling
crashtracking [baseline] (1.242 ms) : 0, 1242
crashtracking [candidate] (1.222 ms) : 0, 1222
BytebuddyAgent [baseline] (710.857 ms) : 0, 710857
BytebuddyAgent [candidate] (710.421 ms) : 0, 710421
GlobalTracer [baseline] (222.624 ms) : 0, 222624
GlobalTracer [candidate] (223.22 ms) : 0, 223220
AppSec [baseline] (32.284 ms) : 0, 32284
AppSec [candidate] (32.699 ms) : 0, 32699
Debugger [baseline] (68.328 ms) : 0, 68328
Debugger [candidate] (68.662 ms) : 0, 68662
Remote Config [baseline] (643.187 µs) : 0, 643
Remote Config [candidate] (647.32 µs) : 0, 647
Telemetry [baseline] (9.078 ms) : 0, 9078
Telemetry [candidate] (9.038 ms) : 0, 9038
Flare Poller [baseline] (3.864 ms) : 0, 3864
Flare Poller [candidate] (4.406 ms) : 0, 4406
ProfilingAgent [baseline] (97.123 ms) : 0, 97123
ProfilingAgent [candidate] (96.7 ms) : 0, 96700
Profiling [baseline] (97.711 ms) : 0, 97711
Profiling [candidate] (97.301 ms) : 0, 97301
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 19 metrics, 16 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section baseline
no_agent (1.216 ms) : 1204, 1228
. : milestone, 1216,
iast (3.232 ms) : 3192, 3272
. : milestone, 3232,
iast_FULL (5.847 ms) : 5788, 5905
. : milestone, 5847,
iast_GLOBAL (3.63 ms) : 3573, 3687
. : milestone, 3630,
profiling (1.935 ms) : 1918, 1952
. : milestone, 1935,
tracing (1.87 ms) : 1854, 1886
. : milestone, 1870,
section candidate
no_agent (1.187 ms) : 1175, 1199
. : milestone, 1187,
iast (3.242 ms) : 3200, 3285
. : milestone, 3242,
iast_FULL (5.721 ms) : 5666, 5777
. : milestone, 5721,
iast_GLOBAL (3.537 ms) : 3478, 3596
. : milestone, 3537,
profiling (1.982 ms) : 1965, 2000
. : milestone, 1982,
tracing (1.774 ms) : 1760, 1788
. : milestone, 1774,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section baseline
no_agent (19.543 ms) : 19342, 19743
. : milestone, 19543,
appsec (18.625 ms) : 18430, 18819
. : milestone, 18625,
code_origins (17.423 ms) : 17249, 17597
. : milestone, 17423,
iast (17.851 ms) : 17673, 18028
. : milestone, 17851,
profiling (19.779 ms) : 19577, 19982
. : milestone, 19779,
tracing (17.542 ms) : 17368, 17715
. : milestone, 17542,
section candidate
no_agent (18.903 ms) : 18710, 19096
. : milestone, 18903,
appsec (18.262 ms) : 18077, 18447
. : milestone, 18262,
code_origins (17.952 ms) : 17773, 18130
. : milestone, 17952,
iast (17.64 ms) : 17462, 17818
. : milestone, 17640,
profiling (19.424 ms) : 19225, 19623
. : milestone, 19424,
tracing (17.506 ms) : 17332, 17681
. : milestone, 17506,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section baseline
no_agent (15.699 s) : 15699000, 15699000
. : milestone, 15699000,
appsec (14.64 s) : 14640000, 14640000
. : milestone, 14640000,
iast (18.392 s) : 18392000, 18392000
. : milestone, 18392000,
iast_GLOBAL (18.048 s) : 18048000, 18048000
. : milestone, 18048000,
profiling (14.746 s) : 14746000, 14746000
. : milestone, 14746000,
tracing (14.871 s) : 14871000, 14871000
. : milestone, 14871000,
section candidate
no_agent (15.563 s) : 15563000, 15563000
. : milestone, 15563000,
appsec (15.112 s) : 15112000, 15112000
. : milestone, 15112000,
iast (18.407 s) : 18407000, 18407000
. : milestone, 18407000,
iast_GLOBAL (17.878 s) : 17878000, 17878000
. : milestone, 17878000,
profiling (14.728 s) : 14728000, 14728000
. : milestone, 14728000,
tracing (15.002 s) : 15002000, 15002000
. : milestone, 15002000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~7c3d62b2ad, baseline=1.59.0-SNAPSHOT~288e1bb70a
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1466, 1489
. : milestone, 1478,
appsec (3.734 ms) : 3513, 3955
. : milestone, 3734,
iast (2.221 ms) : 2156, 2286
. : milestone, 2221,
iast_GLOBAL (2.257 ms) : 2191, 2322
. : milestone, 2257,
profiling (2.073 ms) : 2020, 2126
. : milestone, 2073,
tracing (2.05 ms) : 1999, 2101
. : milestone, 2050,
section candidate
no_agent (1.477 ms) : 1465, 1488
. : milestone, 1477,
appsec (3.709 ms) : 3489, 3929
. : milestone, 3709,
iast (2.221 ms) : 2156, 2285
. : milestone, 2221,
iast_GLOBAL (2.272 ms) : 2206, 2337
. : milestone, 2272,
profiling (2.479 ms) : 2267, 2691
. : milestone, 2479,
tracing (2.057 ms) : 2006, 2108
. : milestone, 2057,
|
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 !
| public static boolean shouldBeAnalyzed(final String internalClassName) { | ||
| return internalClassName.contains("jsp") | ||
| && (internalClassName.contains("_jsp") | ||
| || internalClassName.contains("jsp_") | ||
| || internalClassName.contains("_tag")); | ||
| } |
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.
suggestion: Maybe this method needs to be moved as too jsp specific ?
| private final LimitedConcurrentHashMap map; | ||
|
|
||
| public static final StratumManager INSTANCE = | ||
| new StratumManager(Config.get().getIastSourceMappingMaxSize()); |
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.
thought: Maybe Iast should have its own instance ? And debugger it's own too.
| } | ||
| map.put(className, value); | ||
| if (this.size() >= maxSize) { | ||
| IastMetricCollector.add(IastMetric.SOURCE_MAPPING_LIMIT_REACHED, 1); |
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.
suggestion: Maybe extract that too in the constructor ?
Groovy... |
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]