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 04. May 2007 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.benchmark.strings;
12:
13: import com.thoughtworks.xstream.benchmark.strings.products.StringInternConverter;
14: import com.thoughtworks.xstream.benchmark.strings.products.StringNonCachingConverter;
15: import com.thoughtworks.xstream.benchmark.strings.products.StringWithSynchronizedWeakHashMapConverter;
16: import com.thoughtworks.xstream.benchmark.strings.products.StringWithWeakHashMapConverter;
17: import com.thoughtworks.xstream.benchmark.strings.targets.BigString;
18: import com.thoughtworks.xstream.benchmark.strings.targets.StringArray;
19: import com.thoughtworks.xstream.tools.benchmark.Harness;
20: import com.thoughtworks.xstream.tools.benchmark.metrics.DeserializationSpeedMetric;
21: import com.thoughtworks.xstream.tools.benchmark.reporters.TextReporter;
22:
23: /**
24: * Main application to run harness for StringConverter benchmark.
25: *
26: * @author Jörg Schaible
27: */
28: public class StringsBenchmark {
29: public static void main(String[] args) {
30: Harness harness = new Harness();
31: harness.addMetric(new DeserializationSpeedMetric(10, true));
32: harness.addProduct(new StringNonCachingConverter());
33: harness.addProduct(new StringInternConverter());
34: harness.addProduct(new StringWithWeakHashMapConverter());
35: harness
36: .addProduct(new StringWithSynchronizedWeakHashMapConverter());
37: harness.addTarget(new BigString());
38: harness.addTarget(new StringArray(1024, 1024, 128));
39: harness.addTarget(new StringArray(64 * 1024, 8, 32));
40: harness.run(new TextReporter());
41: }
42: }
|