Package com.thoughtworks.xstream.tools.benchmark.metrics

Examples of com.thoughtworks.xstream.tools.benchmark.metrics.DeserializationSpeedMetric


        Options options = new Options();
        options.addOption("p", "product", true, "Class name of the product to use for benchmark");
        options.addOption("n", true, "Number of repetitions");

        Harness harness = new Harness();
        harness.addMetric(new DeserializationSpeedMetric(0, false) {
            public String toString() {
                return "Initial run deserialization";
            }
        });

        Parser parser = new PosixParser();
        try {
            CommandLine commandLine = parser.parse(options, args);
            String name = null;
            if (commandLine.hasOption('p')) {
                name = commandLine.getOptionValue('p');
            }
            if (name == null || name.equals("DOM")) {
                harness.addProduct(new XStreamDom());
            }
            if (name == null || name.equals("JDOM")) {
                harness.addProduct(new XStreamJDom());
            }
            if (name == null || name.equals("DOM4J")) {
                harness.addProduct(new XStreamDom4J());
            }
            if (name == null || name.equals("XOM")) {
                harness.addProduct(new XStreamXom());
            }
            if (name == null || name.equals("BEAStAX")) {
                harness.addProduct(new XStreamBEAStax());
            }
            if (name == null || name.equals("Woodstox")) {
                harness.addProduct(new XStreamWoodstox());
            }
            if (JVM.is16() && (name == null || name.equals("SJSXP"))) {
                harness.addProduct(new XStreamSjsxp());
            }
            if (name == null || name.equals("Xpp3")) {
                harness.addProduct(new XStreamXpp3());
            }
            if (name == null || name.equals("kXML2")) {
                harness.addProduct(new XStreamKXml2());
            }
            if (name == null || name.equals("Xpp3DOM")) {
                harness.addProduct(new XStreamXpp3DOM());
            }
            if (name == null || name.equals("kXML2DOM")) {
                harness.addProduct(new XStreamKXml2DOM());
            }
            if (commandLine.hasOption('n')) {
                counter = Integer.parseInt(commandLine.getOptionValue('n'));
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
       
        harness.addMetric(new DeserializationSpeedMetric(counter, false));
        harness.addTarget(new BasicTarget());
        harness.addTarget(new ExtendedTarget());
        harness.addTarget(new ReflectionTarget());
        harness.addTarget(new SerializableTarget());
        harness.addTarget(new JavaBeanTarget());
View Full Code Here


        // public String toString() {
        // return "Initial run deserialization";
        // }
        // });
        harness.addMetric(new SerializationSpeedMetric(counter));
        harness.addMetric(new DeserializationSpeedMetric(counter, false));
        if (product == null) {
            harness.addProduct(new NoCache());
            harness.addProduct(new Cache122());
            harness.addProduct(new RealClassCache());
            harness.addProduct(new SerializedClassCache());
View Full Code Here

* @author Jörg Schaible
*/
public class StringsBenchmark {
    public static void main(String[] args) {
        Harness harness = new Harness();
        harness.addMetric(new DeserializationSpeedMetric(10, true));
        harness.addProduct(new StringNonCachingConverter());
        harness.addProduct(new StringInternConverter());
        harness.addProduct(new StringWithWeakHashMapConverter());
        harness.addProduct(new StringWithSynchronizedWeakHashMapConverter());
        harness.addTarget(new BigString());
View Full Code Here

        });

        Harness harness = new Harness();
        harness.addMetric(new SerializationSpeedMetric(100));
        harness.addMetric(new DeserializationSpeedMetric(100, false));
        harness.addProduct(new CombinedLookupReplacer(0));
        // harness.addProduct(new CombinedLookupReplacer(32));
        harness.addProduct(new CombinedLookupAppender(0));
        // harness.addProduct(new CombinedLookupAppender(32));
        harness.addProduct(new SeparateLookupReplacer(0));
View Full Code Here

*/
public class ReflectionBenchmark {
    public static void main(String[] args) {
        Harness harness = new Harness();
        harness.addMetric(new SerializationSpeedMetric(10));
        harness.addMetric(new DeserializationSpeedMetric(10, true));
        harness.addProduct(new XStreamPlain());
        harness.addProduct(new XStreamClassAliases());
        harness.addProduct(new XStreamFieldAliases());
        harness.addProduct(new XStreamLocalAttributeAliases());
        harness.addTarget(new FieldReflection());
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.tools.benchmark.metrics.DeserializationSpeedMetric

Copyright © 2018 www.massapicom. 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.