01: /*
02: * Copyright (C) 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 26. June 2007 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.benchmark.reflection;
12:
13: import com.thoughtworks.xstream.benchmark.reflection.products.XStreamClassAliases;
14: import com.thoughtworks.xstream.benchmark.reflection.products.XStreamFieldAliases;
15: import com.thoughtworks.xstream.benchmark.reflection.products.XStreamLocalAttributeAliases;
16: import com.thoughtworks.xstream.benchmark.reflection.products.XStreamPlain;
17: import com.thoughtworks.xstream.benchmark.reflection.targets.FieldReflection;
18: import com.thoughtworks.xstream.benchmark.reflection.targets.HierarchyLevelReflection;
19: import com.thoughtworks.xstream.benchmark.reflection.targets.InnerClassesReflection;
20: import com.thoughtworks.xstream.benchmark.reflection.targets.StaticInnerClassesReflection;
21: import com.thoughtworks.xstream.tools.benchmark.Harness;
22: import com.thoughtworks.xstream.tools.benchmark.metrics.DeserializationSpeedMetric;
23: import com.thoughtworks.xstream.tools.benchmark.metrics.SerializationSpeedMetric;
24: import com.thoughtworks.xstream.tools.benchmark.reporters.TextReporter;
25:
26: /**
27: * Main application to run harness for Reflection benchmark.
28: *
29: * @author Jörg Schaible
30: */
31: public class ReflectionBenchmark {
32: public static void main(String[] args) {
33: Harness harness = new Harness();
34: harness.addMetric(new SerializationSpeedMetric(10));
35: harness.addMetric(new DeserializationSpeedMetric(10, true));
36: harness.addProduct(new XStreamPlain());
37: harness.addProduct(new XStreamClassAliases());
38: harness.addProduct(new XStreamFieldAliases());
39: harness.addProduct(new XStreamLocalAttributeAliases());
40: harness.addTarget(new FieldReflection());
41: harness.addTarget(new HierarchyLevelReflection());
42: harness.addTarget(new InnerClassesReflection());
43: harness.addTarget(new StaticInnerClassesReflection());
44: harness.run(new TextReporter());
45: }
46: }
|