One other thing is that Petal templates can be compiled down to a very fast form. Last year I had them running as fast as Text::Template (and with some syntax tweaks, considerably faster) but the changes were never integrated into Jean Michel's releases. Something which manipulates HTML trees at run time can't do this.
Here, you have hit the nail dead on the head. You have found the Achilles' Heel of HTML::Seamstress. I had parried and dodged and ducked, but here is where you achieve touche'. Seamstress does runtime tree manipulations with the number of tree traversals per page linear to the number of templating actions. Put in plain talk: each time you need to do some sort of templating action you need to search through the tree to do it.
I recently began work on a compiler to optimize this but quit doing it after realizing that under mod_perl, the HTML tree needs to be created afresh for each new templating operation: I found this out in my test suite. When the first test case was fine but all the rest kept failing. Then I printed out the tree and OMG! The tree is mangled! Must start afresh!
Thanks for the reference to METAL, I had not heard of that. I learned some things about Petal from this. I have noticed a number of repetitive idioms in my HTML manipulation and may one day create shortcuts and a compiler for them. It's just right now I don't want to be telepathic about what I might need.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||