aspose file tools*
The moose likes XML and Related Technologies and the fly likes VTD XML buffer re-use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "VTD XML buffer re-use" Watch "VTD XML buffer re-use" New topic
Author

VTD XML buffer re-use

Venkata Pavan Kumar vemuri
Greenhorn

Joined: Feb 01, 2010
Posts: 14
I am working with VTD xml i have a question regarding buffered reuse feature of the VTD xml. What is the advantage of using buffered re-use feature of VTD xml. will ther be any change in memory used or change in performance? can anyone please elaborate on this ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18907
    
    8

Not surprisingly, the VTD site has something about buffer reuse:

http://vtd-xml.sourceforge.net/faq.html#What%20is%20Buffer%20Reuse
Venkata Pavan Kumar vemuri
Greenhorn

Joined: Feb 01, 2010
Posts: 14
Thank you for your reply...but it gives the definition of what buffer re usability is...buffer re-usability means The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time....

I parsed some XML files using both setDoc and setDoc_BR methods. In my results, i observed that the performance(parsing time) of setDoc_BR is a little better than setDoc. What i'm faliing to analyze is how the buffer re-use concept is affecting the performance of the parser. For example, you want to parse and XML file. You take the file into a buffer(byte array) and assign it to an instance of VTDGen class using the setdoc or setdoc_br methods and parse the file. When you are parsing a single XML file, where does the concept of buffer re-use come?? Coz the one XML file is parsed once and VTD records are put in the buffer and that's it. If you have 2 XML files, the second XML file can re-use the buffer allocated by the application but when its just 1 file that is being parsed, why is the performance better??

If we think that the buffer allocated for the XML file is being re-used for holding the VTD records, what will happen when we want to modify or work with the XML file??Because VTD XML requires that the XML file is in memory. So it looks like that buffer cannot be reused.Can anybody figure out what exactly is going on here with buffer reuse??

Can you explain this concept to me?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18907
    
    8

I would have thought the people at the VTD site were far more qualified to explain that. After all, I have just read the same paragraph that you read. Did you not try asking them? Did they not respond?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: VTD XML buffer re-use