Skip to content

Upgrade to JMH 0.7.3 #1290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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