Adding lighter String processing methods to Strings#10640
Open
Adding lighter String processing methods to Strings#10640
Conversation
- fast replaceAll for a fixed string & replacement, 3x throughput compared to regex based solutions, 1/2x allocation compared to regex solutions - added SubSequence which provides a view into a subsequence of a String without incurring extra allocation - Strings.spliit returns an Iterable<SubSequence> can be used to do light weight processing of a String
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 60 metrics, 11 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.07 s) : 0, 1070167
Total [baseline] (8.76 s) : 0, 8760309
Agent [candidate] (1.063 s) : 0, 1062989
Total [candidate] (8.748 s) : 0, 8748237
section iast
Agent [baseline] (1.233 s) : 0, 1232959
Total [baseline] (9.402 s) : 0, 9401586
Agent [candidate] (1.236 s) : 0, 1235835
Total [candidate] (9.435 s) : 0, 9434930
gantt
title insecure-bank - break down per module: candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.219 ms) : 0, 1219
crashtracking [candidate] (1.198 ms) : 0, 1198
BytebuddyAgent [baseline] (632.515 ms) : 0, 632515
BytebuddyAgent [candidate] (626.939 ms) : 0, 626939
AgentMeter [baseline] (29.243 ms) : 0, 29243
AgentMeter [candidate] (29.017 ms) : 0, 29017
GlobalTracer [baseline] (258.649 ms) : 0, 258649
GlobalTracer [candidate] (257.105 ms) : 0, 257105
AppSec [baseline] (33.244 ms) : 0, 33244
AppSec [candidate] (32.812 ms) : 0, 32812
Debugger [baseline] (63.948 ms) : 0, 63948
Debugger [candidate] (63.897 ms) : 0, 63897
Remote Config [baseline] (618.295 µs) : 0, 618
Remote Config [candidate] (608.178 µs) : 0, 608
Telemetry [baseline] (9.843 ms) : 0, 9843
Telemetry [candidate] (9.92 ms) : 0, 9920
Flare Poller [baseline] (4.533 ms) : 0, 4533
Flare Poller [candidate] (5.354 ms) : 0, 5354
section iast
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.211 ms) : 0, 1211
BytebuddyAgent [baseline] (797.035 ms) : 0, 797035
BytebuddyAgent [candidate] (799.18 ms) : 0, 799180
AgentMeter [baseline] (11.369 ms) : 0, 11369
AgentMeter [candidate] (11.286 ms) : 0, 11286
GlobalTracer [baseline] (248.098 ms) : 0, 248098
GlobalTracer [candidate] (248.515 ms) : 0, 248515
AppSec [baseline] (32.792 ms) : 0, 32792
AppSec [candidate] (30.572 ms) : 0, 30572
Debugger [baseline] (66.814 ms) : 0, 66814
Debugger [candidate] (69.166 ms) : 0, 69166
Remote Config [baseline] (541.562 µs) : 0, 542
Remote Config [candidate] (530.386 µs) : 0, 530
Telemetry [baseline] (8.663 ms) : 0, 8663
Telemetry [candidate] (8.616 ms) : 0, 8616
Flare Poller [baseline] (3.443 ms) : 0, 3443
Flare Poller [candidate] (3.453 ms) : 0, 3453
IAST [baseline] (26.996 ms) : 0, 26996
IAST [candidate] (27.115 ms) : 0, 27115
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1064482
Total [baseline] (10.96 s) : 0, 10960495
Agent [candidate] (1.067 s) : 0, 1067133
Total [candidate] (10.934 s) : 0, 10933857
section appsec
Agent [baseline] (1.242 s) : 0, 1242264
Total [baseline] (11.028 s) : 0, 11027569
Agent [candidate] (1.254 s) : 0, 1253716
Total [candidate] (11.066 s) : 0, 11066116
section iast
Agent [baseline] (1.242 s) : 0, 1241520
Total [baseline] (11.298 s) : 0, 11297860
Agent [candidate] (1.242 s) : 0, 1241505
Total [candidate] (11.225 s) : 0, 11224955
section profiling
Agent [baseline] (1.192 s) : 0, 1191651
Total [baseline] (11.008 s) : 0, 11008439
Agent [candidate] (1.194 s) : 0, 1194236
Total [candidate] (10.973 s) : 0, 10973298
gantt
title petclinic - break down per module: candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.182 ms) : 0, 1182
crashtracking [candidate] (1.201 ms) : 0, 1201
BytebuddyAgent [baseline] (628.302 ms) : 0, 628302
BytebuddyAgent [candidate] (629.387 ms) : 0, 629387
AgentMeter [baseline] (29.178 ms) : 0, 29178
AgentMeter [candidate] (29.158 ms) : 0, 29158
GlobalTracer [baseline] (257.951 ms) : 0, 257951
GlobalTracer [candidate] (258.303 ms) : 0, 258303
AppSec [baseline] (32.938 ms) : 0, 32938
AppSec [candidate] (32.858 ms) : 0, 32858
Debugger [baseline] (64.703 ms) : 0, 64703
Debugger [candidate] (64.283 ms) : 0, 64283
Remote Config [baseline] (604.087 µs) : 0, 604
Remote Config [candidate] (604.436 µs) : 0, 604
Telemetry [baseline] (9.09 ms) : 0, 9090
Telemetry [candidate] (9.838 ms) : 0, 9838
Flare Poller [baseline] (4.478 ms) : 0, 4478
Flare Poller [candidate] (5.348 ms) : 0, 5348
section appsec
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.202 ms) : 0, 1202
BytebuddyAgent [baseline] (659.664 ms) : 0, 659664
BytebuddyAgent [candidate] (666.242 ms) : 0, 666242
AgentMeter [baseline] (12.017 ms) : 0, 12017
AgentMeter [candidate] (12.123 ms) : 0, 12123
GlobalTracer [baseline] (259.022 ms) : 0, 259022
GlobalTracer [candidate] (261.029 ms) : 0, 261029
AppSec [baseline] (168.454 ms) : 0, 168454
AppSec [candidate] (169.61 ms) : 0, 169610
Debugger [baseline] (66.517 ms) : 0, 66517
Debugger [candidate] (67.295 ms) : 0, 67295
Remote Config [baseline] (647.694 µs) : 0, 648
Remote Config [candidate] (657.692 µs) : 0, 658
Telemetry [baseline] (9.569 ms) : 0, 9569
Telemetry [candidate] (9.538 ms) : 0, 9538
Flare Poller [baseline] (3.735 ms) : 0, 3735
Flare Poller [candidate] (3.764 ms) : 0, 3764
IAST [baseline] (25.326 ms) : 0, 25326
IAST [candidate] (25.993 ms) : 0, 25993
section iast
crashtracking [baseline] (1.203 ms) : 0, 1203
crashtracking [candidate] (1.205 ms) : 0, 1205
BytebuddyAgent [baseline] (802.031 ms) : 0, 802031
BytebuddyAgent [candidate] (802.35 ms) : 0, 802350
AgentMeter [baseline] (11.593 ms) : 0, 11593
AgentMeter [candidate] (11.42 ms) : 0, 11420
GlobalTracer [baseline] (249.332 ms) : 0, 249332
GlobalTracer [candidate] (249.565 ms) : 0, 249565
AppSec [baseline] (34.96 ms) : 0, 34960
AppSec [candidate] (33.284 ms) : 0, 33284
Debugger [baseline] (66.065 ms) : 0, 66065
Debugger [candidate] (67.829 ms) : 0, 67829
Remote Config [baseline] (546.479 µs) : 0, 546
Remote Config [candidate] (529.131 µs) : 0, 529
Telemetry [baseline] (8.81 ms) : 0, 8810
Telemetry [candidate] (8.581 ms) : 0, 8581
Flare Poller [baseline] (3.487 ms) : 0, 3487
Flare Poller [candidate] (3.369 ms) : 0, 3369
IAST [baseline] (27.325 ms) : 0, 27325
IAST [candidate] (27.254 ms) : 0, 27254
section profiling
crashtracking [baseline] (1.195 ms) : 0, 1195
crashtracking [candidate] (1.165 ms) : 0, 1165
BytebuddyAgent [baseline] (682.578 ms) : 0, 682578
BytebuddyAgent [candidate] (682.408 ms) : 0, 682408
AgentMeter [baseline] (8.536 ms) : 0, 8536
AgentMeter [candidate] (8.585 ms) : 0, 8585
GlobalTracer [baseline] (216.084 ms) : 0, 216084
GlobalTracer [candidate] (216.954 ms) : 0, 216954
AppSec [baseline] (32.65 ms) : 0, 32650
AppSec [candidate] (32.658 ms) : 0, 32658
Debugger [baseline] (67.049 ms) : 0, 67049
Debugger [candidate] (67.604 ms) : 0, 67604
Remote Config [baseline] (627.15 µs) : 0, 627
Remote Config [candidate] (635.37 µs) : 0, 635
Telemetry [baseline] (8.936 ms) : 0, 8936
Telemetry [candidate] (9.173 ms) : 0, 9173
Flare Poller [baseline] (3.746 ms) : 0, 3746
Flare Poller [candidate] (3.825 ms) : 0, 3825
ProfilingAgent [baseline] (99.613 ms) : 0, 99613
ProfilingAgent [candidate] (100.552 ms) : 0, 100552
Profiling [baseline] (100.181 ms) : 0, 100181
Profiling [candidate] (101.131 ms) : 0, 101131
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 2 performance regressions! Performance is the same for 17 metrics, 17 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section baseline
no_agent (1.164 ms) : 1153, 1176
. : milestone, 1164,
iast (3.122 ms) : 3084, 3159
. : milestone, 3122,
iast_FULL (5.666 ms) : 5610, 5722
. : milestone, 5666,
iast_GLOBAL (3.504 ms) : 3440, 3569
. : milestone, 3504,
profiling (1.983 ms) : 1967, 2000
. : milestone, 1983,
tracing (1.847 ms) : 1832, 1863
. : milestone, 1847,
section candidate
no_agent (1.199 ms) : 1187, 1211
. : milestone, 1199,
iast (3.197 ms) : 3152, 3242
. : milestone, 3197,
iast_FULL (5.888 ms) : 5829, 5947
. : milestone, 5888,
iast_GLOBAL (3.541 ms) : 3476, 3605
. : milestone, 3541,
profiling (2.02 ms) : 2002, 2038
. : milestone, 2020,
tracing (1.752 ms) : 1738, 1766
. : milestone, 1752,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section baseline
no_agent (19.249 ms) : 19050, 19448
. : milestone, 19249,
appsec (18.512 ms) : 18329, 18696
. : milestone, 18512,
code_origins (17.766 ms) : 17588, 17945
. : milestone, 17766,
iast (17.613 ms) : 17439, 17788
. : milestone, 17613,
profiling (18.639 ms) : 18456, 18822
. : milestone, 18639,
tracing (17.563 ms) : 17391, 17734
. : milestone, 17563,
section candidate
no_agent (18.347 ms) : 18158, 18535
. : milestone, 18347,
appsec (18.566 ms) : 18376, 18755
. : milestone, 18566,
code_origins (18.152 ms) : 17968, 18336
. : milestone, 18152,
iast (17.577 ms) : 17402, 17752
. : milestone, 17577,
profiling (18.797 ms) : 18606, 18989
. : milestone, 18797,
tracing (18.687 ms) : 18502, 18872
. : milestone, 18687,
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 tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section baseline
no_agent (1.479 ms) : 1467, 1490
. : milestone, 1479,
appsec (3.802 ms) : 3578, 4026
. : milestone, 3802,
iast (2.266 ms) : 2197, 2335
. : milestone, 2266,
iast_GLOBAL (2.311 ms) : 2241, 2380
. : milestone, 2311,
profiling (2.097 ms) : 2041, 2153
. : milestone, 2097,
tracing (2.078 ms) : 2024, 2132
. : milestone, 2078,
section candidate
no_agent (1.477 ms) : 1466, 1489
. : milestone, 1477,
appsec (3.817 ms) : 3593, 4041
. : milestone, 3817,
iast (2.257 ms) : 2188, 2326
. : milestone, 2257,
iast_GLOBAL (2.308 ms) : 2239, 2378
. : milestone, 2308,
profiling (2.12 ms) : 2064, 2177
. : milestone, 2120,
tracing (2.08 ms) : 2026, 2134
. : milestone, 2080,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.60.0-SNAPSHOT~fa1b8bd149, baseline=1.60.0-SNAPSHOT~2fa3c0c243
dateFormat X
axisFormat %s
section baseline
no_agent (15.063 s) : 15063000, 15063000
. : milestone, 15063000,
appsec (14.99 s) : 14990000, 14990000
. : milestone, 14990000,
iast (18.325 s) : 18325000, 18325000
. : milestone, 18325000,
iast_GLOBAL (17.657 s) : 17657000, 17657000
. : milestone, 17657000,
profiling (15.245 s) : 15245000, 15245000
. : milestone, 15245000,
tracing (14.7 s) : 14700000, 14700000
. : milestone, 14700000,
section candidate
no_agent (14.769 s) : 14769000, 14769000
. : milestone, 14769000,
appsec (14.808 s) : 14808000, 14808000
. : milestone, 14808000,
iast (18.479 s) : 18479000, 18479000
. : milestone, 18479000,
iast_GLOBAL (18.012 s) : 18012000, 18012000
. : milestone, 18012000,
profiling (14.904 s) : 14904000, 14904000
. : milestone, 14904000,
tracing (14.771 s) : 14771000, 14771000
. : milestone, 14771000,
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds to StringUtils
Motivation
In subsequent PRs, these will be used to reduce allocation from String processing throughout dd-trace-java
The first focus area for improvement is QueryObfuscator
Additional Notes
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.