Skip to content

Avoid String allocations in Version#6317

Merged
jkschneider merged 2 commits intomainfrom
avoid-string-allocs-in-version
Nov 28, 2025
Merged

Avoid String allocations in Version#6317
jkschneider merged 2 commits intomainfrom
avoid-string-allocs-in-version

Conversation

@knutwannheden
Copy link
Copy Markdown
Contributor

By not calling String#substring() we can avoid unnecessary String allocations. As Integer#parseInt(CharSequence, int, int, int) is only available in Java 9, I inlined a simplified version of it.

By not calling `String#substring()` we can avoid unnecessary `String` allocations. As `Integer#parseInt(CharSequence, int, int, int)` is only available in Java 9, I inlined a simplified version of it.
@knutwannheden knutwannheden marked this pull request as ready for review November 20, 2025 15:53
@jkschneider jkschneider marked this pull request as draft November 20, 2025 17:16
@jkschneider
Copy link
Copy Markdown
Member

Let's see if the complexity here is worthwhile after we see the effect of Shannon's earlier optimizations around Version are fully rolled out.

@jkschneider jkschneider marked this pull request as ready for review November 28, 2025 14:56
@jkschneider jkschneider merged commit b30b162 into main Nov 28, 2025
2 checks passed
@jkschneider jkschneider deleted the avoid-string-allocs-in-version branch November 28, 2025 14:56
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants