Skip to content

Commit

Permalink
Merge pull request #1560 from paplorinc/benchmarkProfile
Browse files Browse the repository at this point in the history
Added Maven benchmarking profile
  • Loading branch information
danieldietrich authored Sep 15, 2016
2 parents d99b293 + 5e04e2b commit 63e7872
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 9 deletions.
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public interface Map<K, V> extends Traversable<Tuple2<K, V>> {
* Check for new plugin version: `mvn versions:display-plugin-updates`

### Benchmarks

mvn clean test -Pbenchmark
If you have dedicated hardware (i.e. no virtual machines) and are interested in how Javaslang compares to other alternatives,
you can run all benchmarks from the `javaslang-benchmark` module via `javaslang.JmhRunner.main` or running the following Maven command:
```
mvn clean test -P benchmark -pl javaslang-benchmark
```
Note: running all the tests will require several hours, during which there should be no other activity done on the given machine.

### Releasing

Expand Down
2 changes: 1 addition & 1 deletion javaslang-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<version>${maven.surefire.version}</version>
<configuration>
<includes>
<include>**/*Benchmark.java</include>
Expand Down
2 changes: 1 addition & 1 deletion javaslang-benchmark/src/test/java/javaslang/JmhRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static Array<RunResult> run(int warmupIterations, int measurementIterati
Any GC during testing will destroy the iteration (i.e. introduce unreliable noise in the measurement), which should get ignored as an outlier */
.jvmArgsAppend("-XX:+UseG1GC", "-Xss100m", "-Xms4g", "-Xmx4g", "-XX:MaxGCPauseMillis=1000", "-XX:+UnlockExperimentalVMOptions", "-XX:G1NewSizePercent=100", "-XX:G1MaxNewSizePercent=100", assertions.vmArg);

final String includePattern = includeNames.mkString("\\.(", "|", ")_");
final String includePattern = includeNames.mkString("\\..*?(", "|", ")_");
classNames.forEach(name -> builder.include(name + includePattern));

if (printInlining == PrintInlining.ENABLE) {
Expand Down
43 changes: 38 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Note: The maven build currently needs to be started from the javaslang root dir
because the code generators write to hard-coded relative directories.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<prerequisites>
<maven>3.0.4</maven>
Expand Down Expand Up @@ -83,7 +84,9 @@ Note: The maven build currently needs to be started from the javaslang root dir
<maven.javadoc.version>2.10.4</maven.javadoc.version>
<maven.release.version>2.5.3</maven.release.version>
<maven.versions.version>2.3</maven.versions.version>
<maven.surefire.version>2.19.1</maven.surefire.version>
<maven.source.version>3.0.1</maven.source.version>
<maven.exec.version>1.5.0</maven.exec.version>
<maven.gwt.plugin>1.0-rc-6</maven.gwt.plugin>
<scala.maven.version>3.2.2</scala.maven.version>
<scala.version>2.11.7</scala.version>
Expand Down Expand Up @@ -401,7 +404,7 @@ Note: The maven build currently needs to be started from the javaslang root dir
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
<pluginExecution>
Expand All @@ -414,7 +417,7 @@ Note: The maven build currently needs to be started from the javaslang root dir
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
<pluginExecution>
Expand All @@ -427,7 +430,7 @@ Note: The maven build currently needs to be started from the javaslang root dir
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
<pluginExecution>
Expand All @@ -440,7 +443,7 @@ Note: The maven build currently needs to be started from the javaslang root dir
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
Expand All @@ -451,5 +454,35 @@ Note: The maven build currently needs to be started from the javaslang root dir
</pluginManagement>
</build>
</profile>
<!-- A profile for running the benchmarks -->
<profile>
<id>benchmark</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<classpathScope>test</classpathScope>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>javaslang.JmhRunner</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 63e7872

Please sign in to comment.