Skip to content

Commit

Permalink
Use StringBuilder instead of String concat for startup code (#1293)
Browse files Browse the repository at this point in the history
Unfortunately the JDK's indyfied String concatenation
has a slight performance penalty at startup, so for
code we know will always be run at startup, let's not
pay that unnecessary price
With this change we force javac to use the StringBuilder
strategy
  • Loading branch information
geoand authored Jan 16, 2025
1 parent 6800804 commit 3830fb8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<!-- As string concatenation has a non-zero impact on startup, let's disable it for this module -->
<compilerArgument>-XDstringConcat=inline</compilerArgument>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down

0 comments on commit 3830fb8

Please sign in to comment.