• Home
  • Raw
  • Download

Lines Matching +full:google +full:- +full:benchmark

2  * Copyright (C) 2009 Google Inc.
8 * http://www.apache.org/licenses/LICENSE-2.0
19 import com.google.caliper.BeforeExperiment;
20 import com.google.caliper.Benchmark;
21 import com.google.caliper.Param;
30 * We begin the Caliper tutorial with the simplest benchmark you can write.
35 * - We write a class that extends com.google.caliper.Benchmark.
36 * - It contains a public instance method whose name begins with 'time' and
38 * - The body of the method simply executes the code we wish to measure,
44 * [real-time results appear on this line]
48 * Benchmark ns
49 * --------- ---
53 @Benchmark void timeNanoTime(int reps) { in timeNanoTime()
64 * - We simply add another method, following the same rules as the first.
68 * Benchmark ns
69 * ----------------- ---
74 @Benchmark void timeNanoTime(int reps) { in timeNanoTime()
79 @Benchmark void timeCurrentTimeMillis(int reps) { in timeCurrentTimeMillis()
94 @Benchmark void timeArrayIteration_BAD(int reps) { in timeArrayIteration_BAD()
102 * Caliper reported that the benchmark above ran in 4 nanoseconds.
108 * It is very important to sanity-check benchmark results with common sense!
116 * - We simply change the 'time' method from 'void' to any return type we
119 * - We're no longer timing *just* the code we want to be testing - our
130 @Benchmark int timeArrayIteration_fixed(int reps) { in timeArrayIteration_fixed()
143 * don't want to have to cut and paste the whole benchmark just to provide a
146 * When you run this benchmark the same way you ran the previous ones, you'll
147 * now get an error: "No values provided for benchmark parameter 'size'".
150 * [caliper_home]/caliper tutorial.Tutorial.Benchmark5 -Dsize=100}
154 * Benchmark size ns
155 * -------------- ---- ---
158 * Now that we've parameterized our benchmark, things are starting to get fun.
159 * Try passing '-Dsize=10,100,1000' and see what happens!
161 * Benchmark size ns
162 * -------------- ---- -----------------------------------
178 @Benchmark int timeArrayIteration(int reps) { in timeArrayIteration()