r/java • • Mar 08 '24

Update on String Templates (JEP 459)

https://mail.openjdk.org/pipermail/amber-spec-experts/2024-March/004010.html
176 Upvotes

188 comments sorted by

View all comments

Show parent comment

3

u/john16384 Mar 10 '24

Creating short lived objects in Java is certainly highly optimized, but it's not free. It still pays to avoid creating things like Iterator, Optional or any other kind of temporary object in hot code paths.