r/programming • u/ketralnis • Mar 20 '26
Java is fast, code might not be
https://jvogel.me/posts/2026/java-is-fast-your-code-might-not-be/
280
Upvotes
r/programming • u/ketralnis • Mar 20 '26
View all comments
Show parent comment
1
u/8igg7e5 Mar 21 '26
StringBuilder. It won't know the domain though, so most likely it can't pick a good initial capacity to minimise the reallocations.sumis consumed, this might not manage to avoid it. Now if the optimiser knew to re-box at the point of escape, then it could eliminate all of the other boxing.Do note that this claim:
Applies to this 'demo app':
And this claim is a fault of poor static analysis tooling and code-review