I need recommendations on what to use in Delphi (I use Delphi 2009) to handle very large XML files (e.g. 100 MB) as fast as possible.
I need to input the XML, access and update the data in it from my program, and then export the modified XML again.
Hopefully the input and output could be done within a few seconds on a fast Windows machine.
Clarification. I expect I will need to use DOM, because access to the data structure for developing reports and making updates to the data is important, and I need this functionality to be very fast.
The input is only done once for File Loading and the output done only for File saving, usually just once upon exit. These should be quick as well, but are not as important as the in-memory data access and update.
My understanding is that 3rd party parsers only help with input and output, but not on using and modifying the data once loaded into memory. Or am I mistaken on this?
DOM Parser is faster than SAX Parser. Best for the larger sizes of files. Best for the smaller size of files. It is suitable for making XML files in Java.
An XML file is an extensible markup language file, and it is used to structure data for storage and transport. In an XML file, there are both tags and text. The tags provide the structure to the data. The text in the file that you wish to store is surrounded by these tags, which adhere to specific syntax guidelines.
If I understood your question correctly, you have known data structure and you are modifying data - not XML structure of file.
Under these condition and if performance is crucial, then you could try with direct text manipulation - skip XML parsing.
Read from stream, use some fast text search algorithm e.g. Boyer-Moore, to find places where you need to modify data, do your modification and output data into another stream.
This would be one-pass, no XML parsing, no in-memory XML tree building.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With