use of com.cinchapi.common.profile.Benchmark in project accent4j by cinchapi.
the class StringSplitterPerformanceTest method testSimpleSplit.
@Test
@Ignore
public void testSimpleSplit() {
String string = "The Gangs All Here,www.youtube.com/embed/VlWsLs8G7Kg,," + "\"Anacostia follows the lives of the residents of ANACOSTIA, " + "a small residential community in Washington D.C. as they " + "navigate through love, betrayal, deception, sex and murder\"," + "ANACOSTIA,3,7,,Webseries,,,";
int rounds = 5000;
Benchmark builtIn = new Benchmark(TimeUnit.MICROSECONDS) {
@Override
public void action() {
string.split(",");
}
};
Benchmark splitter = new Benchmark(TimeUnit.MICROSECONDS) {
@Override
public void action() {
new StringSplitter(string, ',').toArray();
}
};
double builtInTime = builtIn.average(rounds);
double splitterTime = splitter.average(rounds);
System.out.println("Built-In: " + builtInTime);
System.out.println("Splitter: " + splitterTime);
Assert.assertTrue(splitterTime < builtInTime);
}
use of com.cinchapi.common.profile.Benchmark in project concourse by cinchapi.
the class CrossVersionReadStrategyBenchmarkTest method testSelectSortKeyAndConditionKey.
@Test
public void testSelectSortKeyAndConditionKey() {
Benchmark benchmark = new Benchmark(TimeUnit.MILLISECONDS) {
@Override
public void action() {
client.select("count", Criteria.where().key("count").operator(Operator.GREATER_THAN).value(672), Order.by("count"));
}
};
double avg = benchmark.run(1);
record("testSelectSortKeyAndConditionKey", avg);
}
use of com.cinchapi.common.profile.Benchmark in project concourse by cinchapi.
the class CrossVersionReadStrategyBenchmarkTest method testFindSortKeyAndConditionKey.
@Test
public void testFindSortKeyAndConditionKey() {
Benchmark benchmark = new Benchmark(TimeUnit.MILLISECONDS) {
@Override
public void action() {
client.find(Criteria.where().key("count").operator(Operator.GREATER_THAN).value(672), Order.by("count"));
}
};
double avg = benchmark.run(1);
record("testFindSortKeyAndConditionKey", avg);
}
use of com.cinchapi.common.profile.Benchmark in project concourse by cinchapi.
the class CrossVersionSearchBenchmarkTest method testColdSearchPerformance.
@Test
public void testColdSearchPerformance() {
client.close();
server.stop();
server.start();
client = server.connect();
Benchmark benchmark = new Benchmark(TimeUnit.MILLISECONDS) {
@Override
public void action() {
client.search(key, query);
}
};
double avg = benchmark.average(10);
record("cold", avg);
}
use of com.cinchapi.common.profile.Benchmark in project concourse by cinchapi.
the class CrossVersionSelectAllVsSelectKeysBenchmarkTest method testSelectKeys.
@Test
public void testSelectKeys() {
Benchmark benchmark = new Benchmark(TimeUnit.MILLISECONDS) {
@Override
public void action() {
client.select(ImmutableList.of("name", "age", "company", "active", "title"), records);
}
};
long elapsed = benchmark.run();
record("select keys", elapsed);
}
Aggregations