-
October 9th, 2003, 10:35 AM
#1
speeding up the parsing
Hi,
I have written some code that reads in data from an xml file and inserts the data into variuos database tables.
The xml file has 7-8 levels of netsing and I am using org.w3c.dom parser to parse the file.
However, I am not very happy with its performance and think that it can be enhanced.
Does anyone know of any tricks that can spped this thing up?
-
October 9th, 2003, 11:02 AM
#2
Using a SAX parser instead of DOM might speed things up.
-
October 9th, 2003, 11:14 AM
#3
My manager (who thinks he is Mr know it all) said that he wants me to use DOM so I did. I warned him beforehand that using DOM to parse XML files is not the best way of doing it and could be very slow but his head is too far up his own backside to listen.
Anyway, are there any faster DOM parsers out there that I could use?
-
October 9th, 2003, 11:34 AM
#4
Well you could use Xerces-C++, but of course this requires that you rewrite everything in C++.
http://xml.apache.org/xerces-c/index.html
-
October 9th, 2003, 11:36 AM
#5
I am under time restrictions so I can not re-write the code + I don't think I remember anything from my c++ days.
-
October 9th, 2003, 01:08 PM
#6
Then your only chance of increasing the preformance, is to run it on a faster machine.
-
October 10th, 2003, 04:37 AM
#7
The code is running locally and (in my opinion) the performance is appalling but my machine is quite low spec and has very little RAM and disk space so this could be causing the performance problems.
-
October 10th, 2003, 02:53 PM
#8
If the system is doing a lot of swapping while the program runs, then you would most probably get a good preformace boost, by adding more ram.
If there is one thing java does well, it's taking up lots and lots of memory.
-
October 13th, 2003, 04:05 AM
#9
Your manager is a twit.
If you can convince him JAXB is a clean cut solution.
http://developer.java.sun.com/develo...cles/xml/jaxb/
Trev
-
October 14th, 2003, 08:34 AM
#10
Well, the Xerces-C++ DOM parser is implemented using SAX so you'd be using SAX whether you wanted to or not. The same is probably true of Xerces-J.
It doesn't take long to write a SAX handler. 7-8 object classes? Not too bad. If your PHB doesn't want to invest the time then let it go for now. Save your strength for the battles that really matter.
-rick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|