Re: jdom 1.1
Paul Libbrecht <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Message-ID | <[email protected]> |
Katja, What you describe is scary and I noticed nothing of that. Could you make your test-case a bit more easy to reproduce? (the styled text below is not nice to copy, the xml files are missing). Posting it all on the web, e.g. as a zip, would help. I see that jdom doesn't have a bug tracker, if you prefer such a method, you can happily post this in our bug-tracker (jira.activemath.org, project activemath, component omdocjdom). Maybe we can even discuss a jdom project there. paul Le 01-sept.-08 à 09:49, [email protected] a écrit : > > I read the same file using jdom 1.0 and jdom 1.1 > a file of 25Mb is parsed in 9 seconds with jdom 1.0 and with jdom > 1.1 in 5 minutes. > a file of 73Mb is parsed in 44 seconds with jdom 1.0 and with jdom > 1.1 in 47 minutes! > I only changed the jar files. The code is the same, but the duration > increased with a factor 60. > Can someone tell me why? > Thanks a lot. > > import > > java.io.FileInputStream; > import > > java.io.InputStream; > import > > java.util.ArrayList; > import > > java.util.Calendar; > import > > java.util.Iterator; > import > > > > > java.util.List; > import > > org.jdom.Document; > import > > org.jdom.Element; > import > > > org.jdom.input.SAXBuilder; > > > > > > public > > > > public static void main(String[] args) { > > > > > > > > SAXBuilder saxBuilder=new SAXBuilder(false);try{new > FileInputStream("C:/catalogueDOM36.xml"); > System.out.println("min: > "+Calendar.getInstance().get(Calendar.MINUTE)+" sec: > "+ > Calendar > .getInstance > ().get > (Calendar > .SECOND));readXMLFileWithJDom(jdomDocument);out.println("min: > "+Calendar.getInstance().get(Calendar.MINUTE)+" sec: > "+Calendar.getInstance().get(Calendar.SECOND));catch (Exception e) { > > > > > > > > > > InputStream input= > > Document jdomDocument= saxBuilder.build(input); > > > System. > > > > } > > e.printStackTrace(); > > } > > > } > > > > > > > > > > > > public static void readXMLFileWithJDom(org.jdom.Document > jdomDocument){ > > > > > > > > > Element catalogueElement=jdomDocument.getRootElement(); > > > Catalogue catalogue=readCatalogueElement(catalogueElement); > > > > > > > } > > > public static Catalogue readCatalogueElement(Element element){new > Catalogue();if(children !=null){while (iterator.hasNext()) { > > > catalogue.setDateCreated(readDate(child)); > > } > > catalogue.setDateModified(readDate(child)); > > } > > catalogue.setComment(child.getText()); > > > } > > bookList= > > catalogue.setBookList(bookList); > > readListOfBooks(child, catalogue); > > > } > > > cdList= > > catalogue.setCdList(cdList); > > > readListOfCds(child,catalogue); > > > } > > } > > } > > > > > } > > if(child.getName()=="date_created"){else > if(child.getName()=="date_modified"){else > if(child.getName()=="comment"){else if(child.getName()=="books"){new > ArrayList();else if(child.getName()=="cds"){new ArrayList();return > catalogue; > > > > > ArrayList bookList; > > ArrayList cdList; > > Catalogue catalogue= > > > > > List children=element.getChildren(); > > > Iterator iterator=children.iterator(); > > > Element child = (Element) iterator.next(); > > > class JDomReaderSax { > > > Dit bericht is onderworpen aan de voorwaarden beschikbaar op onze > website > Ce message est soumis aux conditions disponibles sur notre site web > This message is subject to the terms and conditions available on our > website > > Dit bericht is onderworpen aan de voorwaarden beschikbaar op onze > website > Ce message est soumis aux conditions disponibles sur notre site web > This message is subject to the terms and conditions available on our > website > _______________________________________________ > To control your jdom-interest membership: > http://www.jdom.org/mailman/options/jdom-interest/ > [email protected] _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]
smime.p7s
(application/pkcs7-signature, 2.2 KB) - not displayed