Package com.cloudera.util

Examples of com.cloudera.util.Benchmark.mark()


    b.mark("begin");
    for (int i = 0; i < times; i++) {
      ByteBuffer.wrap(base.getBytes());
    }
    b.mark("after " + times);
    b.done();

  }

  @Test
View Full Code Here


  @Test
  public void testStringtoByteBufferCopy() {
    Benchmark b = new Benchmark("String alloc ByteBuf");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      byte[] buf = base.getBytes();
      ByteBuffer bb = ByteBuffer.allocate(buf.length);
      bb.put(buf);
    }
View Full Code Here

    for (int i = 0; i < times; i++) {
      byte[] buf = base.getBytes();
      ByteBuffer bb = ByteBuffer.allocate(buf.length);
      bb.put(buf);
    }
    b.mark("after " + times);
    b.done();
  }

  @Test
  public void testStringToByteArray2() {
View Full Code Here

  @Test
  public void testStringToByteArray2() {
    Benchmark b = new Benchmark("String to ByteArray");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      base.getBytes();
    }
    b.mark("after " + times);
    b.done();
View Full Code Here

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      base.getBytes();
    }
    b.mark("after " + times);
    b.done();
  }

  @Test
  public void testStringToWrapByteBuffer2() {
View Full Code Here

  @Test
  public void testStringToWrapByteBuffer2() {
    Benchmark b = new Benchmark("String wrap ByteBuf");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      ByteBuffer.wrap(base.getBytes());
    }
    b.mark("after " + times);
    b.done();
View Full Code Here

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      ByteBuffer.wrap(base.getBytes());
    }
    b.mark("after " + times);
    b.done();

  }

  @Test
View Full Code Here

  @Test
  public void testStringtoByteBufferCopy2() {
    Benchmark b = new Benchmark("String alloc ByteBuf");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      byte[] buf = base.getBytes();
      ByteBuffer bb = ByteBuffer.allocate(buf.length);
      bb.put(buf);
    }
View Full Code Here

    for (int i = 0; i < times; i++) {
      byte[] buf = base.getBytes();
      ByteBuffer bb = ByteBuffer.allocate(buf.length);
      bb.put(buf);
    }
    b.mark("after " + times);
    b.done();
  }

}
View Full Code Here

  @Test
  public void testStringAppend() {
    Benchmark b = new Benchmark("String Append");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      @SuppressWarnings("unused")
      String temp = base + i;
    }
    b.mark("after " + times);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.