janvladimirmostert
08/27/2018, 6:30 AMmvn clean package
to run in 20-24 minutes
even with the incremental option on, that first mvn package
or running it from IntelliJ takes almost 30 minutes
not sure if Kotlin compile times became much slower or if our code-base became exponentially bigger
we have about 2k lines of Java code and 114k lines of Kotlin code, so not that enormous
any suggestions on how to make it faster?
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
<compilerPlugins>
<plugin>jpa</plugin>
</compilerPlugins>
<pluginOptions>
<option>jpa:annotation=javax.persistence.MappedSuperclass</option>
</pluginOptions>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/main/java</source>
<source>src/main/kotlin</source>
<source>src/main/resources</source>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<sourceDirs>
<source>src/test/java</source>
<source>src/test/kotlin</source>
<source>src/test/resources</source>
</sourceDirs>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-noarg</artifactId>
<version>${kotlin.version}</version>
</dependency>
</dependencies>
</plugin>
denis.zharkov
08/27/2018, 2:10 PMexport MAVEN_OPTS="-agentpath:/path/to/yourkit/agent.so=sampling,onexit=snapshot,delay=0,dir=/path/to/snapshots -Xmx4096m"
YouTrack issue with resulting snapshot is very welcome at
https://youtrack.jetbrains.com/issues/KTjanvladimirmostert
08/27/2018, 9:15 PM[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:35 min
[INFO] Finished at: 2018-08-27T23:11:06+02:00
[INFO] ------------------------------------------------------------------------
down from 25-30min to less than 4min, that's awesome, thanks for the help Denis!
i'll get back to the profiler part to see where it's taking time, screenshotting this and logging as something to get back to as soon as all the high priority stuff are out of the wayjanvladimirmostert
08/27/2018, 9:51 PM8192m
build time is down to 02:56, so cuts a further ±40 seconds
is there a way to specify that parameter directly in the maven compiler plugin so that intellij can pick up on it? I've added it to the maxmem
config option to see if if it makes a difference in IntelliJ:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
<fork>true</fork>
<meminitial>512m</meminitial>
<maxmem>8192m</maxmem>
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
janvladimirmostert
08/28/2018, 6:32 AMmvn clean
before telling IntelliJ to do the run / debug).
Activity monitor shows that the Java process peaks at 3GB of memory, so more memory probably won't speed it up any further.