Ah, sorry I didn't make it clear - in the production code there is no file to load from - here its just a handy way of getting a similar hashref to do timings on. So we can't just compare stringification; we have to convert hashref to $dom then stringify.

Internally in the 'real' system we have 30 odd Classes some of which with 5-10 polymorphic variants that all have a method called output which returns a nested hashref/arrayref structure that can be converted into JSON/XML/Storable etc. These are all assembled into one giant hashref before conversion.

For the example I simply used XMLin to create a hashref that would be similar to what we already - internally (in our real framework) we're working with something that resembles $xml (which is badly named and perhaps should be $nested_hashref_containing_arrayrefs_and_hashrefs). A tiny fragment of it would look like:

$VAR1 = { 'RelationshipPermissions' => { 'PermissionHolderType' => { 'cont +ent' => 'authenticated' }, 'ZName' => { 'content' => 'svz_ +admin_rp' }, 'DisplayName' => { 'content' => + 'Admin Permissions' }, 'IPList' => { 'content' => 'any' }, 'changeable' => { 'content' => 't +rue' }, 'readable' => { 'content' => 'tru +e' }, 'deleteable' => { 'content' => 't +rue' }, 'appendable' => { 'content' => 't +rue' }, 'secureable' => { 'content' => 't +rue' } } };

So whilst the stringification is quicker if we already have a complete DOM object structure - we don't already have that and modifying our code to produce that would a) be a massive task and b) make it more difficult (impossible / slower) to also produce JSON / Storable output.


In reply to Re^2: Replacing XML::Simple XMLout with Lib::XML by amasidlover
in thread Replacing XML::Simple XMLout with Lib::XML by amasidlover

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.