Package com.cloudera.util

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


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

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


  @Test
  public void testStringBufferAppend() {
    StringBuffer buf = new StringBuffer(base);
    Benchmark b = new Benchmark("StringBuffer Append");

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

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

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

  @Test
  public void testStringBuilderAppend() {
    StringBuilder buf = new StringBuilder(base);
    Benchmark b = new Benchmark("StringBuffer Append");

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

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

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

  @Test
  public void testStringFormat() {
    String format = "%s%d";
    Benchmark b = new Benchmark("StringFormatAppend");

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

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

  }

  @Test
View Full Code Here

  @Test
  public void testStringAppend2() {
    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

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

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

  @Test
  public void testStringBufferAppend2() {
    StringBuffer buf = new StringBuffer(base);
    Benchmark b = new Benchmark("StringBuffer Append");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      buf.append(i);
    }
    b.mark("after " + times);
    b.done();
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.