Skip to content

Conversation

@K-jun98
Copy link
Contributor

@K-jun98 K-jun98 commented Nov 13, 2025

Initialize StringBuilder with the expected capacity (this.blank.length()) to avoid unnecessary resizing and array copying during string construction.

The blank field already contains the exact length needed for the formatted output, making it an ideal initial capacity. This improves performance for correlation ID formatting, which is frequently called during logging operations.

Initialize StringBuilder with the expected capacity (this.blank.length())
to avoid unnecessary resizing and array copying during string construction.

The blank field already contains the exact length needed for the formatted
output, making it an ideal initial capacity. This improves performance for
correlation ID formatting, which is frequently called during logging
operations.

Signed-off-by: gobeomjun <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 13, 2025
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 13, 2025
@philwebb philwebb added this to the 3.4.x milestone Nov 13, 2025
@wilkinsona wilkinsona self-assigned this Nov 14, 2025
@wilkinsona wilkinsona modified the milestones: 3.4.x, 3.4.12 Nov 14, 2025
wilkinsona pushed a commit that referenced this pull request Nov 14, 2025
Initialize StringBuilder with the expected capacity (this.blank.length())
to avoid unnecessary resizing and array copying during string construction.

The blank field already contains the exact length needed for the formatted
output, making it an ideal initial capacity. This improves performance for
correlation ID formatting, which is frequently called during logging
operations.

See gh-48125

Signed-off-by: gobeomjun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants