Skip to content
Open
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ subprojects {
compile 'joda-time:joda-time:2.2'
compile 'org.apache.thrift:libthrift:0.20.0'
compile 'commons-configuration:commons-configuration:1.9'
compile group: 'com.cinchapi', name: 'accent4j', version: '1.14.0', changing:true
compile group: 'com.cinchapi', name: 'accent4j', version: '1.15.0', changing:true
compile 'com.cinchapi:lib-config:1.5.1'
compile group: 'com.cinchapi', name: 'lib-cli', version: '1.1.1', changing:true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
Expand All @@ -30,7 +31,6 @@
import java.util.stream.Collectors;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

import com.cinchapi.common.profile.Benchmark;
Expand Down Expand Up @@ -245,7 +245,6 @@ long record = 1;
}

@Test
@Ignore
public void testGatherVsSelectBenchmark() {
java.util.Random rand = new java.util.Random();
Database store = (Database) this.store;
Expand All @@ -267,34 +266,28 @@ long record = records.get(rand.nextInt(records.size()));
}
}
Database $store = store;
Benchmark select = new Benchmark(TimeUnit.MILLISECONDS) {

@Override
public void action() {
for (long record : records) {
for (String key : keys) {
$store.select(key, record);
}
CompletableFuture<Double> select = Benchmark.of(() -> {
for (long record : records) {
for (String key : keys) {
$store.select(key, record);
}
}
}).in(TimeUnit.MILLISECONDS).warmups(1).average(3);

};
Benchmark gather = new Benchmark(TimeUnit.MILLISECONDS) {

@Override
public void action() {
for (long record : records) {
for (String key : keys) {
$store.gather(key, record);
}
CompletableFuture<Double> gather = Benchmark.of(() -> {
for (long record : records) {
for (String key : keys) {
$store.gather(key, record);
}
}
}).in(TimeUnit.MILLISECONDS).async().warmups(1).average(3);

double selectTime = select.join();
double gatherTime = gather.join();

};
double selectTime = select.run(1);
double gatherTime = gather.run(1);
System.out.println("Select took " + selectTime + " ms and gather took "
+ gatherTime + " ms");

Assert.assertTrue(gatherTime <= selectTime);
}

Expand Down