Skip to content

Commit c6d544e

Browse files
author
Jaroslaw Odzga
authored
Merge pull request linkedin#117 from jodzga/perf-improvements
Performance improvements + benchmarks
2 parents 3ef5d0e + c685ee2 commit c6d544e

43 files changed

Lines changed: 1255 additions & 390 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
v2.6.10
2+
------
3+
4+
* Performance optimizations:
5+
- Eagerly drain task queue in SerialExecutor. The goal of this optimization is to avoid expensive context switches and improve memory cache utilization for the price of "fairness". Since this version the default behavior is to drain task queue eagerly. The previous behavior can be enabled by setting Engine configuration property: `Engine.DRAIN_SERIAL_EXECUTOR_QUEUE` to `true`.
6+
- Disable trampoline. Trampoline is a mechanism that allows avoiding stack overflow. It is not without a cost and for certain workflows it is worth turning it off. Since this version trampoline is disabled. It can be enabled using `ParSeqGlobalConfiguration.setTrampolineEnabled()`.
7+
- Use LIFOBiPriorityQueue as a task queue implementation in SerialExecutor. LIFOBiPriorityQueue is a task queue that recognizes only two priorities which allows faster implementation. It also uses LIFO order which can improve memory cache utilization. It is possible to use previous implementation by default by setting Engine configuration property: `Engine.DEFAULT_TASK_QUEUE` to `FIFOPriorityQueue.class.getName()`.
8+
- Avoid creation and copying of arrays in TaskParImpl.
9+
- Tracing improvements. Removed reference counting and replaced usage of HashMaps with ArrayLists.
10+
* Added benchmarks that can be used for testing ParSeq performance. This is just a beginning of work on more reliable and automated performance tests for ParSeq.
11+
112
v2.6.9
213
------
314

contrib/parseq-batching/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.linkedin.parseq</groupId>
66
<artifactId>parseq-batching</artifactId>
7-
<version>2.6.9</version>
7+
<version>2.6.10</version>
88

99
<dependencies>
1010
<dependency>
1111
<groupId>com.linkedin.parseq</groupId>
1212
<artifactId>parseq</artifactId>
13-
<version>2.6.9</version>
13+
<version>2.6.10</version>
1414
</dependency>
1515
<dependency>
1616
<groupId>org.testng</groupId>
@@ -21,7 +21,7 @@
2121
<dependency>
2222
<groupId>com.linkedin.parseq</groupId>
2323
<artifactId>parseq</artifactId>
24-
<version>2.6.9</version>
24+
<version>2.6.10</version>
2525
<classifier>test</classifier>
2626
<scope>test</scope>
2727
</dependency>

contrib/parseq-benchmark/pom.xml

Lines changed: 51 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.linkedin.parseq</groupId>
66
<artifactId>parseq-benchmark</artifactId>
7-
<version>2.6.9</version>
7+
<version>2.6.10</version>
88
<packaging>jar</packaging>
99

1010
<prerequisites>
@@ -13,118 +13,79 @@
1313

1414
<dependencies>
1515
<dependency>
16-
<groupId>org.openjdk.jmh</groupId>
17-
<artifactId>jmh-core</artifactId>
18-
<version>${jmh.version}</version>
16+
<groupId>com.linkedin.parseq</groupId>
17+
<artifactId>parseq</artifactId>
18+
<version>2.6.10</version>
1919
</dependency>
2020
<dependency>
21-
<groupId>org.openjdk.jmh</groupId>
22-
<artifactId>jmh-generator-annprocess</artifactId>
23-
<version>${jmh.version}</version>
24-
<scope>provided</scope>
21+
<groupId>com.linkedin.parseq</groupId>
22+
<artifactId>parseq-batching</artifactId>
23+
<version>2.6.10</version>
2524
</dependency>
2625
<dependency>
27-
<groupId>com.linkedin.parseq</groupId>
28-
<artifactId>parseq</artifactId>
29-
<version>2.6.9</version>
26+
<groupId>org.hdrhistogram</groupId>
27+
<artifactId>HdrHistogram</artifactId>
28+
<version>2.1.8</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.slf4j</groupId>
32+
<artifactId>slf4j-simple</artifactId>
33+
<version>1.7.12</version>
3034
</dependency>
3135
</dependencies>
3236

33-
<properties>
34-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
35-
<jmh.version>1.10.3</jmh.version>
36-
<javac.target>1.8</javac.target>
37-
<uberjar.name>benchmarks</uberjar.name>
38-
</properties>
39-
4037
<build>
4138
<plugins>
4239
<plugin>
4340
<groupId>org.apache.maven.plugins</groupId>
4441
<artifactId>maven-compiler-plugin</artifactId>
45-
<version>3.1</version>
42+
<version>3.0</version>
4643
<configuration>
47-
<compilerVersion>${javac.target}</compilerVersion>
48-
<source>${javac.target}</source>
49-
<target>${javac.target}</target>
44+
<source>1.8</source>
45+
<target>1.8</target>
46+
<testSource>1.8</testSource>
47+
<testTarget>1.8</testTarget>
5048
</configuration>
5149
</plugin>
5250
<plugin>
53-
<groupId>org.apache.maven.plugins</groupId>
54-
<artifactId>maven-shade-plugin</artifactId>
55-
<version>2.2</version>
51+
<groupId>org.codehaus.mojo</groupId>
52+
<artifactId>exec-maven-plugin</artifactId>
53+
<version>1.1</version>
54+
<executions>
55+
<execution>
56+
<goals>
57+
<goal>java</goal>
58+
</goals>
59+
</execution>
60+
</executions>
61+
<configuration>
62+
<mainClass>com.linkedin.parseq.PerfLarge</mainClass>
63+
</configuration>
64+
</plugin>
65+
<plugin>
66+
<artifactId>maven-assembly-plugin</artifactId>
67+
<version>2.4.1</version>
68+
<configuration>
69+
<descriptorRefs>
70+
<descriptorRef>jar-with-dependencies</descriptorRef>
71+
</descriptorRefs>
72+
<archive>
73+
<manifest>
74+
<mainClass>com.linkedin.parseq.PerfLarge</mainClass>
75+
</manifest>
76+
</archive>
77+
</configuration>
5678
<executions>
5779
<execution>
80+
<id>make-assembly</id>
5881
<phase>package</phase>
5982
<goals>
60-
<goal>shade</goal>
83+
<goal>single</goal>
6184
</goals>
62-
<configuration>
63-
<finalName>${uberjar.name}</finalName>
64-
<transformers>
65-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
66-
<mainClass>org.openjdk.jmh.Main</mainClass>
67-
</transformer>
68-
</transformers>
69-
<filters>
70-
<filter>
71-
<!--
72-
Shading signed JARs will fail without this.
73-
http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
74-
-->
75-
<artifact>*:*</artifact>
76-
<excludes>
77-
<exclude>META-INF/*.SF</exclude>
78-
<exclude>META-INF/*.DSA</exclude>
79-
<exclude>META-INF/*.RSA</exclude>
80-
</excludes>
81-
</filter>
82-
</filters>
83-
</configuration>
8485
</execution>
8586
</executions>
8687
</plugin>
8788
</plugins>
88-
<pluginManagement>
89-
<plugins>
90-
<plugin>
91-
<artifactId>maven-clean-plugin</artifactId>
92-
<version>2.5</version>
93-
</plugin>
94-
<plugin>
95-
<artifactId>maven-deploy-plugin</artifactId>
96-
<version>2.8.1</version>
97-
</plugin>
98-
<plugin>
99-
<artifactId>maven-install-plugin</artifactId>
100-
<version>2.5.1</version>
101-
</plugin>
102-
<plugin>
103-
<artifactId>maven-jar-plugin</artifactId>
104-
<version>2.4</version>
105-
</plugin>
106-
<plugin>
107-
<artifactId>maven-javadoc-plugin</artifactId>
108-
<version>2.9.1</version>
109-
</plugin>
110-
<plugin>
111-
<artifactId>maven-resources-plugin</artifactId>
112-
<version>2.6</version>
113-
</plugin>
114-
<plugin>
115-
<artifactId>maven-site-plugin</artifactId>
116-
<version>3.3</version>
117-
</plugin>
118-
<plugin>
119-
<artifactId>maven-source-plugin</artifactId>
120-
<version>2.2.1</version>
121-
</plugin>
122-
<plugin>
123-
<artifactId>maven-surefire-plugin</artifactId>
124-
<version>2.17</version>
125-
</plugin>
126-
</plugins>
127-
</pluginManagement>
12889
</build>
12990

13091
<name>parseq-benchmark</name>
@@ -135,7 +96,7 @@
13596
</scm>
13697
<description>
13798
Set of benchmarks for ParSeq
138-
</description>
99+
</description>
139100
<licenses>
140101
<license>
141102
<name>The Apache Software License, Version 2.0</name>
@@ -149,6 +110,6 @@
149110
<name>Jaroslaw Odzga</name>
150111
<email>jodzga@linkedin.com</email>
151112
</developer>
152-
</developers>
113+
</developers>
153114

154115
</project>

0 commit comments

Comments
 (0)