public void testBenchmark() throws Exception
    {
        if (!"false".equals(System.getProperty("benchmark.skip")))
            return;

        String dir = System.getProperty("benchmark.output_dir");

        PrintStream out = dir == null ? System.out :
                new PrintStream(new FileOutputStream(new File(new File(dir),
                        "protostuff-json-" + System.currentTimeMillis() + ".txt"), true));

        int warmups = Integer.getInteger("benchmark.warmups", 200000);
        int loops = Integer.getInteger("benchmark.loops", 2000000);

        String title = "protostuff-json serialization benchmark for " + loops + " runs";
        out.println(title);
        out.println();

        start(foo, JSON_SERIALIZERS, out, warmups, loops);

        if (System.out != out)
            out.close();
    }
Compare the outputs of different json impls.

@author David Yu
@created Jul 2, 2010
protostuff-json/src/test/java/io/protostuff/JsonCompareOutputsTest.java