Hi y'all,
I'm modifying an application because that it is to switch database source from Mysql (via dbi) to an xml generating database engine that delivers the resultset via an URL (using LWP for now).

Today, the system creates a webpage by populatinf a html template using traditional search/replace of tags with database values (i.e., no framework).

. Initially I started out by using XML::Bare to create a hash with the xml response, which would mean that i could "imitate" the previous behaviour of the Mysql iteration (i.e. iterating over a hash and parse the html template based on the row values). That would mean that I could keep a lot of the structure of the rest of the code, since i'm only switching "hash source".

But. The purpose of switching database engine is performance related, since the mysql is sort of a bottleneck today, and when switching to the new engine I don't want the html parsing to become the new bottleneck. I don't have much of an example to show you, but regarding to my own test (using Time::HiRes for setting measure points) I get the following output:

- Parsing the data to an xml::Bare object takes c:a 1/20 of the time compared to fetching the data
- Iterating over the object rows and parsing takes about 1/4 of the time compared fetching the data
(The source xml for the test values above is about 78 kb (average), where the relation is "the more source data, the more time parsing takes related to fetching it".)
).



So, I basically want to now how much better performance I can get by using for exampel XML::XSLT, and if it is worth it? As you may understand, switching to XSL transformation means that I have to change a lot of other data (code, templates).

Additional questions:
1. Is LWP::Simple a good choice for fetching the data?
2. Is XML::Bare a good choice performance wise? (I've tried XML::Parser but can't get comfortable with it).
3. Are there other methods that you can recommend?

As I said, I don't have any good examples to show you, but I want your "general thoughts" on the subject.

I simply want to change as least as possible, without performance loss when using the new "method". The system itself it quite complex so I want to use as much of the existing structure possible.

In reply to XSL transformation vs. parsing of html - Performance benefits by DreamT

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.