This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am writing an XML by iterating over the java objects (which can be as large as 3000 in number and quite bulky).when i am performing write opeation for one object at a time, in total there would be 3000 write operations.
This slows done my speed considerably.I cheked the method using profiler and it consumes lots of time(as long as 1 hour) which is quite a lot.I checked and there are no hardware issues.
What can be done in this case.Does anyone have any idea of how thsi write operation can be fastened up.
I was thinking to buffer everything and then write it in one shot, but it has some limitations like.. size of data is too large to buffer , secondly on account of some error due to one object all write operation would fail which we dont wat.
Any suggestions in this regard would be of great help. Thanks in advance, Saurabh
Success is not doing extraordinary things but doing ordinary things extraordinarily well.
USE DOCUMENT OBJECT OF JDOM TO STORE THE XML OBJECT AND KEEP ADDING ELEMENTS TO IT, 3000 ELEMENTS IS NOT A BIG NUMBER AND THEN WRITE IT DOWN TO A PHYSICAL FILE. UPTO 200 MB I HAVE WORKED WITH.
Joined: Oct 07, 2003
Originally posted by chetan anurag: USE DOCUMENT OBJECT OF JDOM TO STORE THE XML OBJECT AND KEEP ADDING ELEMENTS TO IT, 3000 ELEMENTS IS NOT A BIG NUMBER AND THEN WRITE IT DOWN TO A PHYSICAL FILE. UPTO 200 MB I HAVE WORKED WITH.
Thats a good idea nurag but JDOM wont allow 2 way binding i.e. java object to xml and vice vers.Secondly, its a DOM based implementation which is supposed to be slower than SAX based like CASTOR.
So still will you ask me to use JDOM ? Can you highlight some difference between CASTOR and JDOM or prove JDOM is better than CASTOR. Performance is also a factor for me.