Skip to content

Commit

Permalink
Merge pull request #1290 from benjchristensen/jmh-upgrade
Browse files Browse the repository at this point in the history
Upgrade to JMH 0.7.3
  • Loading branch information
benjchristensen committed May 30, 2014
2 parents 1a5fe63 + 2470459 commit 428c0b5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 35 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ subprojects {
}

dependencies {
perfCompile 'org.openjdk.jmh:jmh-core:0.5.3'
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:0.5.3'
//perfCompile project
perfCompile 'org.openjdk.jmh:jmh-core:0.7.3'
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:0.7.3'
}

artifacts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.logic.BlackHole;

import rx.Observable;
Expand All @@ -27,30 +28,6 @@ public class OperatorSerializePerformance extends AbstractPerformanceTester {
super(reps);
}

public static void main(String args[]) {

final OperatorSerializePerformance spt = new OperatorSerializePerformance();
final Input input = new Input();
input.setup();
try {
spt.runTest(new Action0() {

@Override
public void call() {
// spt.noSerializationSingleThreaded(input);
spt.serializedSingleStream(input);
// spt.synchronizedSingleStream(input);
// spt.timeTwoStreams();
// spt.timeSingleStream();
// spt.timeTwoStreamsIntervals();
}
});
} catch (Exception e) {
e.printStackTrace();
}

}

/**
* Run: 10 - 12,186,982 ops/sec
* Run: 11 - 10,236,722 ops/sec
Expand Down Expand Up @@ -379,7 +356,8 @@ public static class Input {

private CountDownLatch latch;

public void setup() {
@Setup
public void setup(final BlackHole bh) {
observable = Observable.create(new OnSubscribe<Integer>() {
@Override
public void call(Subscriber<? super Integer> o) {
Expand All @@ -392,7 +370,6 @@ public void call(Subscriber<? super Integer> o) {
}
});

final BlackHole bh = new BlackHole();
latch = new CountDownLatch(1);

subscriber = new TestSubscriber<Integer>(new Observer<Integer>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class InputWithIncrementingInteger {
private CountDownLatch latch;

@Setup
public void setup() {
public void setup(final BlackHole bh) {
observable = Observable.create(new OnSubscribe<Integer>() {
@Override
public void call(Subscriber<? super Integer> o) {
Expand All @@ -55,7 +55,6 @@ public void call(Subscriber<? super Integer> o) {
}
});

final BlackHole bh = new BlackHole();
latch = new CountDownLatch(1);

observer = new Observer<Integer>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static class Input {
private CountDownLatch latch;

@Setup
public void setup() {
public void setup(final BlackHole bh) {
observable = Observable.create(new OnSubscribe<Integer>() {
@Override
public void call(Subscriber<? super Integer> o) {
Expand All @@ -67,7 +67,6 @@ public void call(Subscriber<? super Integer> o) {
}
});

final BlackHole bh = new BlackHole();
latch = new CountDownLatch(1);

subscriber = new TestSubscriber<Integer>(new Observer<Integer>() {
Expand Down
3 changes: 1 addition & 2 deletions rxjava-core/src/perf/java/rx/usecases/UseCaseInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class UseCaseInput {
private CountDownLatch latch;

@Setup
public void setup() {
public void setup(final BlackHole bh) {
observable = Observable.create(new OnSubscribe<Integer>() {
@Override
public void call(Subscriber<? super Integer> o) {
Expand All @@ -53,7 +53,6 @@ public void call(Subscriber<? super Integer> o) {
}
});

final BlackHole bh = new BlackHole();
latch = new CountDownLatch(1);

observer = new Observer<Integer>() {
Expand Down

0 comments on commit 428c0b5

Please sign in to comment.