-
Notifications
You must be signed in to change notification settings - Fork 300
Replace a regex-based SMAP parser with a hand-crafted one #8730
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
Open
jbachorik
wants to merge
1
commit into
master
Choose a base branch
from
jb/smap
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 61 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.068 s) : 0, 1067833
Total [baseline] (8.728 s) : 0, 8728154
Agent [candidate] (1.064 s) : 0, 1064402
Total [candidate] (8.723 s) : 0, 8722666
section iast
Agent [baseline] (1.188 s) : 0, 1187953
Total [baseline] (9.226 s) : 0, 9226366
Agent [candidate] (1.192 s) : 0, 1191815
Total [candidate] (9.283 s) : 0, 9282544
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.195 s) : 0, 1194714
Total [baseline] (9.242 s) : 0, 9242311
Agent [candidate] (1.194 s) : 0, 1193874
Total [candidate] (9.231 s) : 0, 9230894
section iast_TELEMETRY_OFF
Agent [baseline] (1.186 s) : 0, 1185816
Total [baseline] (9.265 s) : 0, 9265041
Agent [candidate] (1.191 s) : 0, 1191152
Total [candidate] (9.241 s) : 0, 9241054
gantt
title insecure-bank - break down per module: candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (728.919 ms) : 0, 728919
BytebuddyAgent [candidate] (724.378 ms) : 0, 724378
GlobalTracer [baseline] (241.792 ms) : 0, 241792
GlobalTracer [candidate] (241.467 ms) : 0, 241467
AppSec [baseline] (56.499 ms) : 0, 56499
AppSec [candidate] (55.156 ms) : 0, 55156
Debugger [baseline] (7.714 ms) : 0, 7714
Debugger [candidate] (8.448 ms) : 0, 8448
Remote Config [baseline] (700.103 µs) : 0, 700
Remote Config [candidate] (725.464 µs) : 0, 725
Telemetry [baseline] (8.513 ms) : 0, 8513
Telemetry [candidate] (10.696 ms) : 0, 10696
section iast
BytebuddyAgent [baseline] (841.817 ms) : 0, 841817
BytebuddyAgent [candidate] (843.309 ms) : 0, 843309
GlobalTracer [baseline] (230.064 ms) : 0, 230064
GlobalTracer [candidate] (231.291 ms) : 0, 231291
IAST [baseline] (25.674 ms) : 0, 25674
IAST [candidate] (25.251 ms) : 0, 25251
AppSec [baseline] (51.152 ms) : 0, 51152
AppSec [candidate] (52.487 ms) : 0, 52487
Debugger [baseline] (5.846 ms) : 0, 5846
Debugger [candidate] (5.937 ms) : 0, 5937
Remote Config [baseline] (590.483 µs) : 0, 590
Remote Config [candidate] (605.35 µs) : 0, 605
Telemetry [baseline] (7.889 ms) : 0, 7889
Telemetry [candidate] (7.928 ms) : 0, 7928
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (846.196 ms) : 0, 846196
BytebuddyAgent [candidate] (846.037 ms) : 0, 846037
GlobalTracer [baseline] (230.606 ms) : 0, 230606
GlobalTracer [candidate] (230.29 ms) : 0, 230290
IAST [baseline] (23.382 ms) : 0, 23382
IAST [candidate] (23.875 ms) : 0, 23875
AppSec [baseline] (51.588 ms) : 0, 51588
AppSec [candidate] (54.853 ms) : 0, 54853
Debugger [baseline] (5.985 ms) : 0, 5985
Debugger [candidate] (5.885 ms) : 0, 5885
Remote Config [baseline] (603.523 µs) : 0, 604
Remote Config [candidate] (589.759 µs) : 0, 590
Telemetry [baseline] (7.966 ms) : 0, 7966
Telemetry [candidate] (7.849 ms) : 0, 7849
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (839.903 ms) : 0, 839903
BytebuddyAgent [candidate] (843.841 ms) : 0, 843841
GlobalTracer [baseline] (230.337 ms) : 0, 230337
GlobalTracer [candidate] (230.306 ms) : 0, 230306
IAST [baseline] (22.216 ms) : 0, 22216
IAST [candidate] (22.6 ms) : 0, 22600
AppSec [baseline] (55.644 ms) : 0, 55644
AppSec [candidate] (56.395 ms) : 0, 56395
Debugger [baseline] (5.85 ms) : 0, 5850
Debugger [candidate] (6.025 ms) : 0, 6025
Remote Config [baseline] (597.764 µs) : 0, 598
Remote Config [candidate] (613.384 µs) : 0, 613
Telemetry [baseline] (7.815 ms) : 0, 7815
Telemetry [candidate] (7.834 ms) : 0, 7834
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1065934
Total [baseline] (10.595 s) : 0, 10594642
Agent [candidate] (1.059 s) : 0, 1058908
Total [candidate] (10.537 s) : 0, 10536682
section appsec
Agent [baseline] (1.202 s) : 0, 1201817
Total [baseline] (10.718 s) : 0, 10717717
Agent [candidate] (1.2 s) : 0, 1200410
Total [candidate] (10.757 s) : 0, 10756739
section iast
Agent [baseline] (1.188 s) : 0, 1187820
Total [baseline] (10.908 s) : 0, 10908498
Agent [candidate] (1.194 s) : 0, 1194013
Total [candidate] (11.035 s) : 0, 11035343
section profiling
Agent [baseline] (1.311 s) : 0, 1311200
Total [baseline] (10.774 s) : 0, 10774375
Agent [candidate] (1.321 s) : 0, 1320970
Total [candidate] (10.753 s) : 0, 10753357
gantt
title petclinic - break down per module: candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (727.093 ms) : 0, 727093
BytebuddyAgent [candidate] (722.463 ms) : 0, 722463
GlobalTracer [baseline] (240.773 ms) : 0, 240773
GlobalTracer [candidate] (239.353 ms) : 0, 239353
AppSec [baseline] (56.0 ms) : 0, 56000
AppSec [candidate] (56.408 ms) : 0, 56408
Debugger [baseline] (8.517 ms) : 0, 8517
Debugger [candidate] (7.558 ms) : 0, 7558
Remote Config [baseline] (708.799 µs) : 0, 709
Remote Config [candidate] (693.857 µs) : 0, 694
Telemetry [baseline] (9.211 ms) : 0, 9211
Telemetry [candidate] (8.896 ms) : 0, 8896
section appsec
BytebuddyAgent [baseline] (739.744 ms) : 0, 739744
BytebuddyAgent [candidate] (739.766 ms) : 0, 739766
GlobalTracer [baseline] (236.534 ms) : 0, 236534
GlobalTracer [candidate] (236.207 ms) : 0, 236207
AppSec [baseline] (176.33 ms) : 0, 176330
AppSec [candidate] (175.214 ms) : 0, 175214
Debugger [baseline] (6.678 ms) : 0, 6678
Debugger [candidate] (6.688 ms) : 0, 6688
Remote Config [baseline] (630.532 µs) : 0, 631
Remote Config [candidate] (624.968 µs) : 0, 625
Telemetry [baseline] (7.45 ms) : 0, 7450
Telemetry [candidate] (7.438 ms) : 0, 7438
IAST [baseline] (21.757 ms) : 0, 21757
IAST [candidate] (21.811 ms) : 0, 21811
section iast
BytebuddyAgent [baseline] (841.055 ms) : 0, 841055
BytebuddyAgent [candidate] (843.809 ms) : 0, 843809
GlobalTracer [baseline] (229.856 ms) : 0, 229856
GlobalTracer [candidate] (232.153 ms) : 0, 232153
AppSec [baseline] (56.462 ms) : 0, 56462
AppSec [candidate] (54.368 ms) : 0, 54368
Debugger [baseline] (5.904 ms) : 0, 5904
Debugger [candidate] (6.034 ms) : 0, 6034
Remote Config [baseline] (594.629 µs) : 0, 595
Remote Config [candidate] (615.57 µs) : 0, 616
Telemetry [baseline] (7.833 ms) : 0, 7833
Telemetry [candidate] (7.992 ms) : 0, 7992
IAST [baseline] (22.728 ms) : 0, 22728
IAST [candidate] (23.126 ms) : 0, 23126
section profiling
ProfilingAgent [baseline] (103.244 ms) : 0, 103244
ProfilingAgent [candidate] (104.826 ms) : 0, 104826
BytebuddyAgent [baseline] (712.374 ms) : 0, 712374
BytebuddyAgent [candidate] (718.79 ms) : 0, 718790
GlobalTracer [baseline] (376.139 ms) : 0, 376139
GlobalTracer [candidate] (377.954 ms) : 0, 377954
AppSec [baseline] (54.178 ms) : 0, 54178
AppSec [candidate] (53.668 ms) : 0, 53668
Debugger [baseline] (6.156 ms) : 0, 6156
Debugger [candidate] (6.217 ms) : 0, 6217
Remote Config [baseline] (660.612 µs) : 0, 661
Remote Config [candidate] (677.337 µs) : 0, 677
Telemetry [baseline] (8.053 ms) : 0, 8053
Telemetry [candidate] (8.171 ms) : 0, 8171
Profiling [baseline] (103.27 ms) : 0, 103270
Profiling [candidate] (104.851 ms) : 0, 104851
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section baseline
no_agent (384.691 µs) : 364, 405
. : milestone, 385,
iast (526.952 µs) : 504, 550
. : milestone, 527,
iast_FULL (740.96 µs) : 717, 765
. : milestone, 741,
iast_GLOBAL (574.044 µs) : 552, 596
. : milestone, 574,
iast_HARDCODED_SECRET_DISABLED (517.555 µs) : 494, 541
. : milestone, 518,
iast_INACTIVE (472.957 µs) : 450, 496
. : milestone, 473,
iast_TELEMETRY_OFF (514.378 µs) : 491, 537
. : milestone, 514,
tracing (459.216 µs) : 438, 481
. : milestone, 459,
section candidate
no_agent (384.192 µs) : 364, 404
. : milestone, 384,
iast (514.555 µs) : 493, 536
. : milestone, 515,
iast_FULL (732.231 µs) : 709, 755
. : milestone, 732,
iast_GLOBAL (576.537 µs) : 553, 600
. : milestone, 577,
iast_HARDCODED_SECRET_DISABLED (516.965 µs) : 494, 540
. : milestone, 517,
iast_INACTIVE (465.666 µs) : 443, 488
. : milestone, 466,
iast_TELEMETRY_OFF (502.568 µs) : 479, 526
. : milestone, 503,
tracing (457.449 µs) : 436, 479
. : milestone, 457,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section baseline
no_agent (1.353 ms) : 1333, 1374
. : milestone, 1353,
appsec (1.738 ms) : 1714, 1762
. : milestone, 1738,
appsec_no_iast (1.738 ms) : 1715, 1761
. : milestone, 1738,
code_origins (1.731 ms) : 1704, 1758
. : milestone, 1731,
iast (1.525 ms) : 1502, 1549
. : milestone, 1525,
profiling (1.53 ms) : 1506, 1554
. : milestone, 1530,
tracing (1.494 ms) : 1469, 1520
. : milestone, 1494,
section candidate
no_agent (1.365 ms) : 1345, 1385
. : milestone, 1365,
appsec (1.754 ms) : 1731, 1778
. : milestone, 1754,
appsec_no_iast (1.735 ms) : 1710, 1760
. : milestone, 1735,
code_origins (1.655 ms) : 1628, 1683
. : milestone, 1655,
iast (1.506 ms) : 1481, 1531
. : milestone, 1506,
profiling (1.531 ms) : 1507, 1555
. : milestone, 1531,
tracing (1.491 ms) : 1466, 1516
. : milestone, 1491,
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.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section baseline
no_agent (15.421 s) : 15421000, 15421000
. : milestone, 15421000,
appsec (15.138 s) : 15138000, 15138000
. : milestone, 15138000,
iast (19.106 s) : 19106000, 19106000
. : milestone, 19106000,
iast_GLOBAL (18.314 s) : 18314000, 18314000
. : milestone, 18314000,
profiling (15.676 s) : 15676000, 15676000
. : milestone, 15676000,
tracing (14.995 s) : 14995000, 14995000
. : milestone, 14995000,
section candidate
no_agent (14.668 s) : 14668000, 14668000
. : milestone, 14668000,
appsec (14.852 s) : 14852000, 14852000
. : milestone, 14852000,
iast (18.66 s) : 18660000, 18660000
. : milestone, 18660000,
iast_GLOBAL (18.343 s) : 18343000, 18343000
. : milestone, 18343000,
profiling (15.109 s) : 15109000, 15109000
. : milestone, 15109000,
tracing (14.719 s) : 14719000, 14719000
. : milestone, 14719000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.49.0-SNAPSHOT~7adc76db3c, baseline=1.49.0-SNAPSHOT~511416f4ef
dateFormat X
axisFormat %s
section baseline
no_agent (1.473 ms) : 1462, 1485
. : milestone, 1473,
appsec (2.372 ms) : 2325, 2418
. : milestone, 2372,
iast (2.156 ms) : 2097, 2215
. : milestone, 2156,
iast_GLOBAL (2.2 ms) : 2141, 2259
. : milestone, 2200,
profiling (1.995 ms) : 1948, 2042
. : milestone, 1995,
tracing (1.978 ms) : 1933, 2023
. : milestone, 1978,
section candidate
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.375 ms) : 2329, 2422
. : milestone, 2375,
iast (2.146 ms) : 2087, 2204
. : milestone, 2146,
iast_GLOBAL (2.194 ms) : 2135, 2253
. : milestone, 2194,
profiling (2.494 ms) : 2312, 2675
. : milestone, 2494,
tracing (1.983 ms) : 1937, 2028
. : milestone, 1983,
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What Does This Do
In a nut-shell, it replaces the regex based smap entry parser with a minimalistic hand-crafted one.
Motivation
Regex based smap parser is allocating a lot and shows up on profiles of mostly idle applications prominently.
We should try to reduce the allocation rate of the parser not to create panic in users when the smap events collection is enabled and allow us to enable it by default, as it can provide useful data for investigating memory issues.
Additional Notes
Compared to the current implementation, the new parser reduces the CPU usage of otherwise idle application by ~30% (600ms vs. 400ms normalized) but what is more important, the allocation rate drops by ~75% (85MiB vs. 25MiB normalized).
Although this might not seem as much, it paints a slightly less scary picture when enabled on mostly idle services.
The data is captured here - service
samples
is the new implementation, whereassamples-1.48.2
is the one available in version 1.48.2Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: PROF-11713