How do you expect us to come up with more than general handwaving suggestions if you don't show any code and only tell us about your framework as a black box? Well the thing is, having learnt what I have learnt about things like catalyst etc, even I can slag my own code off as being extremely naive, i'm not so much trying to get people to fix my code, as to present the syntax I wrote it to work with, in the hope that if someone can grasp the nature of the syntax itself (and why it rocks) they will realise why I either need help with it or I'm going to spend the next 3-5 years of my life hacking away at it alone in the dark.

here is a rough pseudo-code of what the parser does... please don't laugh too much!

load plugins, build plugin hash table load appropriate body.aXML while ( commands_remain_unprocessed ) { for each plugin_name in plugins hash { scan using a regex for a corresponding tag making sure it does not contain any subtags if tag has been found that is ready to be computed { eval the code from the plugin file, passing it the data from inside the tag and any attribute values place the $result back into the document in the place of the original tag&data } } }
My implemention is very naive! I'm sure that in a single scan/pass over the document it could be run/compiled whatever, however my version scans over the doc many times and the processing overhead grows rapidly with each extra tag / nesting level present (bad, very bad).

Look... I didn't know that 0.04 seconds was a bad render time until recently, I thought I was doing quite well with it, the code I have is ROCK solid, the forum system I linked to earlier has been online for months without problems or resets and it runs on a box which cost $20 / month. If I used a 32 core processor dedicated box, I could just brute force process my performance problems out of the way, but I am trying to do two things by coming here with this:

1) share what I have because I am sure people will like it when they get it

2) garner support and insight in how to compile and process such a syntax in a more efficient manner than multi-passing regexes and evals, so that the solution will scale nicely to larger sizes without needing a server the size of jupiter.

In reply to Re^6: Too difficult for me... by simonodell
in thread Too difficult for me... by simonodell

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.