title: Make JAXB go faster
body: <p>I have a 8 Meg file.  Marshalling using JAXB takes 1082ms, using DOM takes 862ms, using SAX takes 438ms.  This is using all defaults with JDK 1.6, no extra configuration such as using woodstox is used.</p>
  
  <p>In an effort, to get better performance from JAXB, I try to make it use SAX parsing by doing...</p>
  
  <pre><code>FileReader fr = new FileReader("myfile.xml");
  JAXBContext jc = JAXBContext.newInstance(MyObjectList.class);
  Unmarshaller unmarshaller = jc.createUnmarshaller();
  
  XMLInputFactory xmlif = XMLInputFactory.newInstance();
  XMLEventReader xmler = xmlif.createXMLEventReader(fr);
  
  long beginTime = System.currentTimeMillis();
  MyObjectList obj = (MyObjectList)unmarshaller.unmarshal(xmler);
  long endTime = System.currentTimeMillis();
  </code></pre>
  
  <p>This makes it go even slower - 3207ms.</p>
  
  <p>My questions are:
  1. How do I make JAXB go faster?
  2. How can I be 100% sure what underlying parsing mechanism it is using?</p>