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.

  1. 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".
  2. 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.


In reply to Re: XML::Simple noisy option? by pg
in thread XML::Simple noisy option? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.