I didn't read the source code of XML::Simple and all those related, but theoretically no SAX parser should slurp a whole file before it start parsing, if it does, it is really poorly designed, and should not consider to use it at all.
The design objective of SAX is to parse XML data as a stream on fly. Remember the data source can be a TCP port, SAX would parse the XML stream when data is still coming.
As a design cosideration, it would be terribly inefficient, not to use the idle time in between TCP communication. Terrible.
On the other hand, remember, even with all the best design consideration, XML parsing is still very slow. This is not something you can escape at this stage of XML's life cycle.
Update:
After received serveral msg's from
mirod. I realized that this is some orange/apple thing.
- XML::Simple does not "slurp" the file in order to use SAX parser. When I say "slurp", I mean to read in the whole file BEFORE parsing. This is my version of "slurp".
- XML::Simple would eventually store the WHOLE result it got back from the parser in memory, so eventually the file is "slurped". That's his version of "slurp".
I understood that XML::Simple did that, that's okay with me and that's the purpose of XML::Simple, but that's not my "slurp" ;-)
A person finished 9 scoops of ice cream in 1 minute, I will say he slurped it. Another person finished 9 scoops of ice cream in 1 hour, yes, the ice cream eventually all stored in his gut ;-) but I don't call that slurp.
I think we down voted each other, that's fine and that's part of the life here ;-). Couple of XP points is much less important than to make the facts straight. In this sense, we both did well.