-
Notifications
You must be signed in to change notification settings - Fork 313
Improves per-operation latency in HttpHeaderMap access #9409
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?
Conversation
🎯 Code Coverage 🔗 Commit SHA: f398082 | Docs | Was this helpful? Give us feedback! |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 12 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1051746
Total [baseline] (10.753 s) : 0, 10752759
Agent [candidate] (1.057 s) : 0, 1057369
Total [candidate] (10.733 s) : 0, 10733208
section appsec
Agent [baseline] (1.231 s) : 0, 1230825
Total [baseline] (10.815 s) : 0, 10815392
Agent [candidate] (1.232 s) : 0, 1232278
Total [candidate] (10.782 s) : 0, 10782433
section iast
Agent [baseline] (1.191 s) : 0, 1190751
Total [baseline] (11.008 s) : 0, 11008359
Agent [candidate] (1.183 s) : 0, 1183045
Total [candidate] (10.93 s) : 0, 10930450
section profiling
Agent [baseline] (1.202 s) : 0, 1201888
Total [baseline] (10.917 s) : 0, 10916586
Agent [candidate] (1.21 s) : 0, 1210369
Total [candidate] (10.975 s) : 0, 10974812
gantt
title petclinic - break down per module: candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.447 ms) : 0, 1447
crashtracking [candidate] (1.462 ms) : 0, 1462
BytebuddyAgent [baseline] (734.568 ms) : 0, 734568
BytebuddyAgent [candidate] (738.933 ms) : 0, 738933
GlobalTracer [baseline] (243.72 ms) : 0, 243720
GlobalTracer [candidate] (246.008 ms) : 0, 246008
AppSec [baseline] (30.333 ms) : 0, 30333
AppSec [candidate] (30.623 ms) : 0, 30623
Debugger [baseline] (6.083 ms) : 0, 6083
Debugger [candidate] (6.153 ms) : 0, 6153
Remote Config [baseline] (678.171 µs) : 0, 678
Remote Config [candidate] (676.739 µs) : 0, 677
Telemetry [baseline] (13.792 ms) : 0, 13792
Telemetry [candidate] (12.348 ms) : 0, 12348
section appsec
crashtracking [baseline] (1.456 ms) : 0, 1456
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (760.593 ms) : 0, 760593
BytebuddyAgent [candidate] (762.391 ms) : 0, 762391
GlobalTracer [baseline] (236.71 ms) : 0, 236710
GlobalTracer [candidate] (237.264 ms) : 0, 237264
IAST [baseline] (23.893 ms) : 0, 23893
IAST [candidate] (23.603 ms) : 0, 23603
AppSec [baseline] (172.063 ms) : 0, 172063
AppSec [candidate] (169.934 ms) : 0, 169934
Debugger [baseline] (5.793 ms) : 0, 5793
Debugger [candidate] (6.564 ms) : 0, 6564
Remote Config [baseline] (636.001 µs) : 0, 636
Remote Config [candidate] (623.906 µs) : 0, 624
Telemetry [baseline] (8.516 ms) : 0, 8516
Telemetry [candidate] (9.255 ms) : 0, 9255
section iast
crashtracking [baseline] (1.457 ms) : 0, 1457
crashtracking [candidate] (1.436 ms) : 0, 1436
BytebuddyAgent [baseline] (858.63 ms) : 0, 858630
BytebuddyAgent [candidate] (853.713 ms) : 0, 853713
GlobalTracer [baseline] (235.921 ms) : 0, 235921
GlobalTracer [candidate] (234.001 ms) : 0, 234001
IAST [baseline] (29.982 ms) : 0, 29982
IAST [candidate] (29.388 ms) : 0, 29388
AppSec [baseline] (28.714 ms) : 0, 28714
AppSec [candidate] (26.888 ms) : 0, 26888
Debugger [baseline] (5.792 ms) : 0, 5792
Debugger [candidate] (7.535 ms) : 0, 7535
Remote Config [baseline] (618.731 µs) : 0, 619
Remote Config [candidate] (607.407 µs) : 0, 607
Telemetry [baseline] (8.446 ms) : 0, 8446
Telemetry [candidate] (8.359 ms) : 0, 8359
section profiling
crashtracking [baseline] (1.44 ms) : 0, 1440
crashtracking [candidate] (1.454 ms) : 0, 1454
BytebuddyAgent [baseline] (765.129 ms) : 0, 765129
BytebuddyAgent [candidate] (769.785 ms) : 0, 769785
GlobalTracer [baseline] (223.802 ms) : 0, 223802
GlobalTracer [candidate] (225.346 ms) : 0, 225346
AppSec [baseline] (30.351 ms) : 0, 30351
AppSec [candidate] (30.591 ms) : 0, 30591
Debugger [baseline] (6.31 ms) : 0, 6310
Debugger [candidate] (6.368 ms) : 0, 6368
Remote Config [baseline] (714.423 µs) : 0, 714
Remote Config [candidate] (710.062 µs) : 0, 710
Telemetry [baseline] (16.16 ms) : 0, 16160
Telemetry [candidate] (16.746 ms) : 0, 16746
ProfilingAgent [baseline] (108.028 ms) : 0, 108028
ProfilingAgent [candidate] (109.335 ms) : 0, 109335
Profiling [baseline] (108.646 ms) : 0, 108646
Profiling [candidate] (109.978 ms) : 0, 109978
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047895
Total [baseline] (8.605 s) : 0, 8604837
Agent [candidate] (1.058 s) : 0, 1058196
Total [candidate] (8.636 s) : 0, 8636251
section iast
Agent [baseline] (1.183 s) : 0, 1182842
Total [baseline] (9.319 s) : 0, 9319062
Agent [candidate] (1.199 s) : 0, 1199416
Total [candidate] (9.351 s) : 0, 9350806
gantt
title insecure-bank - break down per module: candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.462 ms) : 0, 1462
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (732.853 ms) : 0, 732853
BytebuddyAgent [candidate] (739.173 ms) : 0, 739173
GlobalTracer [baseline] (242.283 ms) : 0, 242283
GlobalTracer [candidate] (244.636 ms) : 0, 244636
AppSec [baseline] (29.956 ms) : 0, 29956
AppSec [candidate] (30.467 ms) : 0, 30467
Debugger [baseline] (6.041 ms) : 0, 6041
Debugger [candidate] (6.125 ms) : 0, 6125
Remote Config [baseline] (660.297 µs) : 0, 660
Remote Config [candidate] (676.164 µs) : 0, 676
Telemetry [baseline] (13.678 ms) : 0, 13678
Telemetry [candidate] (14.476 ms) : 0, 14476
section iast
crashtracking [baseline] (1.458 ms) : 0, 1458
crashtracking [candidate] (1.47 ms) : 0, 1470
BytebuddyAgent [baseline] (853.255 ms) : 0, 853255
BytebuddyAgent [candidate] (866.137 ms) : 0, 866137
GlobalTracer [baseline] (233.708 ms) : 0, 233708
GlobalTracer [candidate] (236.265 ms) : 0, 236265
IAST [baseline] (29.657 ms) : 0, 29657
IAST [candidate] (29.199 ms) : 0, 29199
AppSec [baseline] (26.23 ms) : 0, 26230
AppSec [candidate] (28.468 ms) : 0, 28468
Debugger [baseline] (8.529 ms) : 0, 8529
Debugger [candidate] (7.607 ms) : 0, 7607
Remote Config [baseline] (612.276 µs) : 0, 612
Remote Config [candidate] (614.999 µs) : 0, 615
Telemetry [baseline] (8.322 ms) : 0, 8322
Telemetry [candidate] (8.404 ms) : 0, 8404
LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 12 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section baseline
no_agent (36.492 ms) : 36199, 36785
. : milestone, 36492,
appsec (48.386 ms) : 47939, 48832
. : milestone, 48386,
code_origins (44.941 ms) : 44550, 45332
. : milestone, 44941,
iast (46.166 ms) : 45747, 46585
. : milestone, 46166,
profiling (47.95 ms) : 47495, 48405
. : milestone, 47950,
tracing (43.672 ms) : 43298, 44045
. : milestone, 43672,
section candidate
no_agent (36.17 ms) : 35880, 36459
. : milestone, 36170,
appsec (48.644 ms) : 48188, 49100
. : milestone, 48644,
code_origins (43.689 ms) : 43316, 44063
. : milestone, 43689,
iast (43.73 ms) : 43354, 44106
. : milestone, 43730,
profiling (48.106 ms) : 47670, 48542
. : milestone, 48106,
tracing (43.951 ms) : 43582, 44319
. : milestone, 43951,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section baseline
no_agent (4.407 ms) : 4357, 4457
. : milestone, 4407,
iast (9.193 ms) : 9043, 9344
. : milestone, 9193,
iast_FULL (13.857 ms) : 13584, 14131
. : milestone, 13857,
iast_GLOBAL (10.094 ms) : 9905, 10283
. : milestone, 10094,
profiling (9.109 ms) : 8969, 9248
. : milestone, 9109,
tracing (7.803 ms) : 7683, 7923
. : milestone, 7803,
section candidate
no_agent (4.47 ms) : 4420, 4520
. : milestone, 4470,
iast (9.33 ms) : 9178, 9483
. : milestone, 9330,
iast_FULL (14.145 ms) : 13861, 14430
. : milestone, 14145,
iast_GLOBAL (10.47 ms) : 10284, 10656
. : milestone, 10470,
profiling (8.933 ms) : 8793, 9073
. : milestone, 8933,
tracing (7.568 ms) : 7453, 7682
. : milestone, 7568,
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.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section baseline
no_agent (14.88 s) : 14880000, 14880000
. : milestone, 14880000,
appsec (14.62 s) : 14620000, 14620000
. : milestone, 14620000,
iast (18.57 s) : 18570000, 18570000
. : milestone, 18570000,
iast_GLOBAL (18.201 s) : 18201000, 18201000
. : milestone, 18201000,
profiling (15.62 s) : 15620000, 15620000
. : milestone, 15620000,
tracing (15.166 s) : 15166000, 15166000
. : milestone, 15166000,
section candidate
no_agent (14.991 s) : 14991000, 14991000
. : milestone, 14991000,
appsec (14.78 s) : 14780000, 14780000
. : milestone, 14780000,
iast (18.317 s) : 18317000, 18317000
. : milestone, 18317000,
iast_GLOBAL (18.161 s) : 18161000, 18161000
. : milestone, 18161000,
profiling (15.725 s) : 15725000, 15725000
. : milestone, 15725000,
tracing (14.85 s) : 14850000, 14850000
. : milestone, 14850000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.53.0-SNAPSHOT~f3980825c2, baseline=1.53.0-SNAPSHOT~47394fd13e
dateFormat X
axisFormat %s
section baseline
no_agent (1.48 ms) : 1468, 1491
. : milestone, 1480,
appsec (2.454 ms) : 2401, 2506
. : milestone, 2454,
iast (2.187 ms) : 2124, 2249
. : milestone, 2187,
iast_GLOBAL (2.236 ms) : 2173, 2299
. : milestone, 2236,
profiling (2.04 ms) : 1990, 2091
. : milestone, 2040,
tracing (2.02 ms) : 1971, 2069
. : milestone, 2020,
section candidate
no_agent (1.474 ms) : 1463, 1486
. : milestone, 1474,
appsec (3.645 ms) : 3425, 3864
. : milestone, 3645,
iast (2.196 ms) : 2134, 2258
. : milestone, 2196,
iast_GLOBAL (2.237 ms) : 2174, 2300
. : milestone, 2237,
profiling (2.059 ms) : 2007, 2110
. : milestone, 2059,
tracing (2.018 ms) : 1969, 2066
. : milestone, 2018,
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
What Does This Do
Optimizes HttpHeaderMap by avoiding % (modulo) in hash index computation when the bucket count is a power of two. It adds:
powerOfTwo ? (hash & mask) : (hash % bucketCount)
Slightly improves per-operation latency in HttpHeaderMap access (~6.5% faster: 21.38 ns → 19.99 ns) with no change in memory allocations (~0 B/op) or GC activity.
Motivation
Using hash & (bucketCount - 1) is significantly faster than % bucketCount when the count is a power of two — a common case in hash-based structures. This improves CPU efficiency without affecting behavior or memory usage.
Additional Notes
Useful in hot paths; no behavioral or memory trade-offs introduced.
Contributor 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: [PROJ-IDENT]