public static void main(String[] args) throws SAXException, IOException,
            ParserConfigurationException {
        boolean html = "h".equals(args[0]);
        long duration = Long.parseLong(args[1]) * 60000L;
        String path = args[2];
        
        char[] testData = loadFileIntoArray(new File(path));
        
        XmlSerializer ch = new XmlSerializer(new NullWriter());
        
        XMLReader reader = null;
        if (html) {
            HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALLOW);
            parser.setContentHandler(ch);
            parser.setStreamabilityViolationPolicy(XmlViolationPolicy.FATAL);
            reader = parser;
        } else {
            SAXParserFactory factory = SAXParserFactory.newInstance();
            factory.setNamespaceAware(true);
            factory.setValidating(false);
            reader = factory.newSAXParser().getXMLReader();
            reader.setContentHandler(ch);
            reader.setEntityResolver(new NullEntityResolver());
        }
        System.out.println("Warmup:");
        System.out.println((new ParserPerfHarness(System.currentTimeMillis()
                + duration, reader, testData)).runLoop());
        System.gc();
        System.out.println("Real:");
        System.out.println((new ParserPerfHarness(System.currentTimeMillis()
                + duration, reader, testData)).runLoop());
    }
@param args
@throws IOException
@throws SAXException
@throws ParserConfigurationException
resources/examples/research-src/nu/validator/perftest/ParserPerfHarness.java