examples
Class CopyArrayBenchmark

java.lang.Object
  extended by com.google.caliper.api.Benchmark
      extended by com.google.caliper.SimpleBenchmark
          extended by examples.CopyArrayBenchmark
All Implemented Interfaces:
com.google.caliper.Benchmark

public class CopyArrayBenchmark
extends com.google.caliper.SimpleBenchmark

Tests each of the three (non-manual) ways to copy an array, for all nine array types.

For a recent (2010) build of OpenJDK on linux, this benchmark confirms these facts:


Nested Class Summary
static class CopyArrayBenchmark.Strategy
           
 
Constructor Summary
CopyArrayBenchmark()
           
 
Method Summary
static void main(String[] args)
           
protected  void setUp()
           
 int timeBooleans(int reps)
           
 int timeBytes(int reps)
           
 int timeChars(int reps)
           
 int timeDoubles(int reps)
           
 int timeFloats(int reps)
           
 int timeInts(int reps)
           
 int timeLongs(int reps)
           
 int timeObjects(int reps)
           
 int timeShorts(int reps)
           
 
Methods inherited from class com.google.caliper.SimpleBenchmark
bytesToUnits, createBenchmark, getInstanceUnitNames, getMemoryUnitNames, getTimeUnitNames, instancesToUnits, nanosToUnits, normalizeScenario, parameterNames, parameterValues, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyArrayBenchmark

public CopyArrayBenchmark()
Method Detail

setUp

protected void setUp()
Overrides:
setUp in class com.google.caliper.SimpleBenchmark

timeObjects

public int timeObjects(int reps)

timeBooleans

public int timeBooleans(int reps)

timeBytes

public int timeBytes(int reps)

timeChars

public int timeChars(int reps)

timeDoubles

public int timeDoubles(int reps)

timeFloats

public int timeFloats(int reps)

timeInts

public int timeInts(int reps)

timeLongs

public int timeLongs(int reps)

timeShorts

public int timeShorts(int reps)

main

public static void main(String[] args)


Copyright © 2009-2011 Google, Inc.. All Rights Reserved.