Skip to content
Commits on Source (4)
<img src="https://github.com/conversant/disruptor/blob/master/src/main/resources/ConversantDisruptorLogo.png?raw=true">
# Conversant ConcurrentQueue and Disruptor BlockingQueue
# Conversant ConcurrentQueue, Disruptor BlockingQueue and ConcurrentStack
Disruptor is the highest performing intra-thread transfer mechanism available in Java. Conversant Disruptor is the highest performing implementation of this type of ring buffer queue because it has almost no overhead and it exploits a particularly simple design.
Disruptor is the highest performing intra-thread transfer mechanism available in Java. Conversant Disruptor is the highest performing implementation of this type of ring buffer because it has almost no overhead and it exploits a particularly simple design.
<table>
<td><img src="https://github.com/conversant/disruptor/blob/master/benchmark/benchmark.jpg?raw=true"></td><tr>
<caption><strong>2017 Conversant Disruptor - Still the World's Fastest</strong></caption>
</table>
# Getting Started
Simply run the maven build to build and use the package.
Run the maven build to build and use the package.
```$ mvn -U clean package```
# Conversant Disruptor is on Maven Central
Maven Java 8 users can incorporate Conversant Disruptor the usual way:
For Java 8, Include Conversant Disruptor from Maven Central:
```
<dependency>
<groupId>com.conversantmedia</groupId>
<artifactId>disruptor</artifactId>
<version>1.2.10</version>
<version>1.2.14</version>
<classifier>jdk8</classifier>
</dependency>
```
OR
For Java 10:
```
<dependency>
<groupId>com.conversantmedia</groupId>
<artifactId>disruptor</artifactId>
<version>1.2.10</version>
<version>1.2.14</version>
<classifier>jdk10</classifier>
</dependency>
```
Java 7 is also supported
Or through the default Java 8 jar
```
<dependency>
<groupId>com.conversantmedia</groupId>
<artifactId>disruptor</artifactId>
<version>1.2.14</version>
</dependency>
```
Java 7 is only supported in 1.2.10 and below.
```
<dependency>
......@@ -43,9 +59,10 @@ Java 7 is also supported
</dependency>
```
Java 9 is no longer supported.
## Discussion Forum
Conversant Disruptor has a google group so you can follow releases and changes:
https://groups.google.com/forum/#!forum/conversant-disruptor
......@@ -8,3 +8,4 @@
1.2.8 - Padding changes
1.2.9 - bug fixes
1.2.10 - major point release, cleanup, adding MPMC, @Contended annotation
1.2.11 - Java 8 specific performance improvements, Java 7 no longer supported
Conversant 31.148
MPMC 52.401
LMAX 61.129
LinkedTransferQueue 125.511
ConcurrentStack 169.317
ArrayBlockingQueue 376.906
reset
set terminal jpeg
set output "benchmark.jpg"
set style fill solid 1.00 border 0
set style histogram
set style data histogram
set xtics rotate by -45
set grid ytics linestyle 1
set xlabel "Conversant Disruptor vs Competition (Intel Xeon - Broadwell)" font "bold"
set ylabel "time (ms)" font "bold"
plot "performance.dat" using 2:xtic(1) ti "1M Transactions" linecolor rgb "#0066FF"
......@@ -5,10 +5,10 @@
<groupId>com.conversantmedia</groupId>
<artifactId>disruptor</artifactId>
<packaging>jar</packaging>
<version>1.2.11</version>
<version>1.2.15</version>
<name>${project.groupId}:${project.artifactId}</name>
<url>https://github.com/conversant/disruptor</url>
<description>Conversant Disruptor - very low latency Java BlockingQueue</description>
<description>Conversant Disruptor - very high throughput Java BlockingQueue</description>
<inceptionYear>2012</inceptionYear>
......@@ -21,8 +21,7 @@
<developer>
<name>John Cairns</name>
<email>john@2ad.com</email>
<organization>Conversant, Inc.</organization>
<organizationUrl>http://engineering.conversantmedia.com</organizationUrl>
<organizationUrl>https://github.com/jac18281828</organizationUrl>
</developer>
</developers>
......@@ -70,6 +69,18 @@
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<pluginManagement>
<plugins>
<plugin>
......@@ -176,7 +187,21 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<version>1.11</version>
<executions>
<execution>
<id>add-integration-test-source</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/it/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
......@@ -213,6 +238,16 @@
<profiles>
<!-- Java 7 is no longer supported as of release 1.2.11 -->
<!-- Java 9 is no longer supported as of release 1.2.12 -->
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<jdkClassifier></jdkClassifier>
</properties>
</profile>
<profile>
<id>jdk8</id>
<activation>
......@@ -223,12 +258,12 @@
</properties>
</profile>
<profile>
<id>jdk9</id>
<id>jdk10</id>
<activation>
<jdk>1.9</jdk>
<jdk>10</jdk>
</activation>
<properties>
<jdkClassifier>jdk9</jdkClassifier>
<jdkClassifier>jdk10</jdkClassifier>
</properties>
</profile>
</profiles>
......
......@@ -20,13 +20,13 @@ package com.conversantmedia.util.concurrent;
* #L%
*/
import com.conversantmedia.util.concurrent.ConcurrentQueue;
import org.junit.Ignore;
import com.conversantmedia.util.estimation.Percentile;
/**
* Created by jcairns on 5/29/14.
*/
@Ignore
public class ConcurrentQueuePerformanceTest {
// increase this number for a legit performance test
......
package com.conversantmedia.util.concurrent;
import com.conversantmedia.util.collection.Stack;
import com.conversantmedia.util.concurrent.ConcurrentStack;
import org.junit.Assert;
import org.junit.Test;
......
package com.conversantmedia.util.concurrent;
import com.conversantmedia.util.collection.Stack;
import com.conversantmedia.util.concurrent.ConcurrentStack;
import org.junit.Ignore;
import org.junit.Test;
......
package com.conversantmedia.util.concurrent;
import com.conversantmedia.util.concurrent.DisruptorBlockingQueue;
import com.conversantmedia.util.concurrent.SpinPolicy;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
......@@ -11,7 +13,6 @@ import java.util.concurrent.TimeUnit;
/**
* Created by jcairns on 2/23/16.
*/
@Ignore // stress test
public class DisruptorFairSchedulingTest {
private static final int NTHREAD = 4*Runtime.getRuntime().availableProcessors();
......
package com.conversantmedia.util.concurrent;
import com.conversantmedia.util.concurrent.DisruptorBlockingQueue;
import com.conversantmedia.util.concurrent.SpinPolicy;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
......@@ -14,7 +16,6 @@ import java.util.concurrent.TimeUnit;
/**
* Created by jcairns on 2/23/16.
*/
@Ignore // stress test
public class DisruptorOfferPollStressTest {
private static final int QUEUE_SZ = 1024;
......
......@@ -30,7 +30,7 @@ import static com.conversantmedia.util.concurrent.ContendedAtomicLong.CACHE_LINE
* Created by jcairns on 12/11/14.
*/
// abstract condition supporting common condition code
abstract class AbstractWaitingCondition implements Condition {
public abstract class AbstractWaitingCondition implements Condition {
private static final int CACHE_LINE_REFS = CACHE_LINE/Long.BYTES;
......@@ -45,11 +45,12 @@ abstract class AbstractWaitingCondition implements Condition {
private final LongAdder waitCount = new LongAdder();
@sun.misc.Contended
private final AtomicReferenceArray<Thread> waiter = new AtomicReferenceArray<>(MAX_WAITERS+2*CACHE_LINE_REFS);
@sun.misc.Contended
long r1, r2, r3, r4, r5, r6, r7;
private long waitCache = 0L;
long c1, c2, c3, c4, c5, c6, c7, c8;
/**
* code below will block until test() returns false
......