String += vs. StringBuilder.append #java #shorts #coding #airhacks

preview_player
Показать описание

Java used in this short: openjdk version "21" 2023-09-19 LTS

#airhacks
Рекомендации по теме
Комментарии
Автор

Nice. We knew this, but nice to see it in a short in the favourite language

nistb
Автор

This shows that for 99% of all cases it is irrelevant for performance since nobody concats 100k Strings.

zickzack
Автор

Adam what do you think of compiling yo native binaries from java source?

hephestosthalays
Автор

Concatenation with plus internally becomes string builder. No difference in newer versions of Java

mikeb
visit shbcf.ru