[GitHub] tomee pull request #219: Avoid String in a loop

2018-11-26 Thread asfgit
Github user asfgit closed the pull request at: https://github.com/apache/tomee/pull/219 ---

Re: Avoid String in a loop

2018-11-26 Thread Jonathan Gallimore
I was surprised the figures were as different as they are. I appreciate Romain's feedback - I suspect we won't see dramatic performance increases, but it certainly doesn't do us any harm, so I'll merge this in. Thanks for the patch! Jon On Mon, Nov 26, 2018 at 2:40 PM Romain Manni-Bucau wrote:

Re: Avoid String in a loop

2018-11-26 Thread Romain Manni-Bucau
+0 (this is only for error cases as far as i saw and a few concatenations so you don't see the diff in practise + the compiler is able to optimize it and even replace string builder when relevant these days) Romain Manni-Bucau @rmannibucau | Blog

[GitHub] tomee pull request #219: Avoid String in a loop

2018-11-26 Thread danielsoro
Github user danielsoro commented on a diff in the pull request: https://github.com/apache/tomee/pull/219#discussion_r236279011 --- Diff: container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java --- @@ -2939,12 +2939,14 @@ public EjbModule deploy(final

Re: Avoid String in a loop

2018-11-26 Thread Daniel Cunha
Wowww! Nice catch Otávio! That is really a good improvement! Em seg, 26 de nov de 2018 às 10:47, Otávio Gonçalves de Santana < osant...@tomitribe.com> escreveu: > The reason to prefer StringBuilder is that both + and concat create a new > object every time you call them (provided the right-hand

Avoid String in a loop

2018-11-26 Thread Otávio Gonçalves de Santana
The reason to prefer StringBuilder is that both + and concat create a new object every time you call them (provided the right-hand side argument is not empty). This can quickly add up to a lot of objects, almost all of which are completely unnecessary. public class Main{ public static void mai

[GitHub] tomee pull request #219: Avoid String in a loop

2018-11-26 Thread otaviojava
GitHub user otaviojava opened a pull request: https://github.com/apache/tomee/pull/219 Avoid String in a loop The reason to prefer StringBuilder is that both + and concat create a new object every time you call them (provided the right-hand side argument is not empty). This can