Skip to content

Guard debug/trace LogMessage calls in hot paths#19253

Open
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:gh-19251
Open

Guard debug/trace LogMessage calls in hot paths#19253
therepanic wants to merge 1 commit into
spring-projects:mainfrom
therepanic:gh-19251

Conversation

@therepanic
Copy link
Copy Markdown
Contributor

@therepanic therepanic commented Jun 1, 2026

The main issue is that if we don't use isDebugEnabled or isTraceEnabled to check, we end up allocating LogMessage instances. In this commit, I want to fix what I believe are performance bottlenecks that may occur frequently.

If you'd like, we could also create an issue to address the remaining issues of this nature. In that case, we could create an issue and a sub-issue for each module. But for now, I think we should focus on the hot paths.

Closes: gh-19251

The main issue is that if we don't use `isDebugEnabled` or
`isTraceEnabled` to check, we end up allocating `LogMessage` instances.
In this commit, I want to fix what I believe are performance bottlenecks
that may occur frequently.

Closes: spring-projectsgh-19251

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RegexRequestMatcher.matches() allocates LogMessage wrapper on every request even when debug disabled

2 participants