Search in sources :

Example 1 with Benchmark

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);
}
Also used : Benchmark(com.cinchapi.common.profile.Benchmark) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with Benchmark

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);
}
Also used : Benchmark(com.cinchapi.common.profile.Benchmark) Test(org.junit.Test)

Example 3 with Benchmark

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);
}
Also used : Benchmark(com.cinchapi.common.profile.Benchmark) Test(org.junit.Test)

Example 4 with Benchmark

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);
}
Also used : Benchmark(com.cinchapi.common.profile.Benchmark) Test(org.junit.Test)

Example 5 with Benchmark

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);
}
Also used : Benchmark(com.cinchapi.common.profile.Benchmark) Test(org.junit.Test)

Aggregations

Benchmark (com.cinchapi.common.profile.Benchmark)23 Test (org.junit.Test)23 AtomicSupport (com.cinchapi.concourse.server.storage.AtomicSupport)4 TObject (com.cinchapi.concourse.thrift.TObject)2 CountUpLatch (com.cinchapi.common.concurrent.CountUpLatch)1 CsvImporter (com.cinchapi.concourse.importer.CsvImporter)1 Importer (com.cinchapi.concourse.importer.Importer)1 Value (com.cinchapi.concourse.server.model.Value)1 LazyTrackingTObjectResultDataset (com.cinchapi.concourse.server.plugin.data.LazyTrackingTObjectResultDataset)1 StoreTest (com.cinchapi.concourse.server.storage.StoreTest)1 ClientServerTest (com.cinchapi.concourse.test.ClientServerTest)1 ConcourseBaseTest (com.cinchapi.concourse.test.ConcourseBaseTest)1 Random (com.cinchapi.concourse.util.Random)1 AtomicDouble (com.google.common.util.concurrent.AtomicDouble)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ByteBuffer (java.nio.ByteBuffer)1 Path (java.nio.file.Path)1 Map (java.util.Map)1 Set (java.util.Set)1 CountDownLatch (java.util.concurrent.CountDownLatch)1