Home | History | Annotate | Download | only in benchmarks

Lines Matching refs:Action

104       benchmark("Serialize to byte string", inputData.length, new Action() {
107 benchmark("Serialize to byte array", inputData.length, new Action() {
110 benchmark("Serialize to memory stream", inputData.length, new Action() {
116 benchmark("Serialize to /dev/null with FileOutputStream", inputData.length, new Action() {
121 benchmark("Serialize to /dev/null reusing FileOutputStream", inputData.length, new Action() {
128 benchmark("Deserialize from byte string", inputData.length, new Action() {
133 benchmark("Deserialize from byte array", inputData.length, new Action() {
139 benchmark("Deserialize from memory stream", inputData.length, new Action() {
156 private static void benchmark(String name, long dataSize, Action action) throws IOException {
159 action.execute();
164 long elapsed = timeAction(action, iterations);
167 elapsed = timeAction(action, iterations);
173 elapsed = timeAction(action, iterations);
180 private static long timeAction(Action action, int iterations) throws IOException {
184 action.execute();
198 * Interface used to capture a single action to benchmark.
200 interface Action {