Ian Mahuron wrote:
> 
> As per someone's suggestion I'll ellaborate on what's in the HTML...
> 
> Insert code for advertisment (there's 1,000's of different ads on the
> site.):
> <ADVERTISMENT id=252>
> 
> Insert news scroller:
> <NEWS_ITEM id=92834 bgcolor="#0066FF">
> 
> There will be at least 50 similar tags.. so I'm not parsing for just a
> couple of tags like HTML::Template..
> 
> I may implement IF/LOOPS/etc.. but not until I see the need.
> 
> I've written up a few test benches for HTML::Parser.. it works ok, but it's
> not as fast as I would like it to be.
> 

What Matt brought up is right.  It does not have to matter as much
how fast the parsing is if you can keep your pages compiled
as subroutines like Embperl, Registry, Mason, & ASP do.

If you are going to implement your own module, I would start
with Apache::Registry, which is where I got the initial 
Apache::ASP code compilation & caching methods.  

A Registry rip off approach is fairly simple though, and 
doesn't have a lot of the nice features that other environments 
have like Embperl, Mason & ASP, but if all you want to do is 
handle your special tags, and nothing more, this will be
the best / fastest solution.  Registry has lower overhead
per request because it does not have as much to set up.

If you want to use Apache::ASP for your framework, I would 
be able to provide for you a preparser hook, a Script_OnCompile
subroutine which you would define in the global.asa, and
you would be able to modify your scripts at compile time, to 
hook into Apache::ASP functionality, like converting a tag 

  <ADVERTISMENT id=252>

into

  # execute dynamic include
  <!--#include file=advertisement.inc args=252-->

or 

  # run perl subroutine
  <% &ADVERTISEMENT(252); %>

Another approach generic to other modules would be to 
use Apache::Filter to preprocess the script, before
handing it off to another module like SSI, ASP, or 
EmbperlFilter (?), which are filter aware modules.
The only problem here is that the processing overhead
is significantly more when filtering, than a compile
time hook would be.

Note that I am sitting on a development version of 
Apache::ASP which is at least 20%-30% faster at startup,
and 10%-20% faster at runtime than previous versions, so if 
you look at benchmarks at http://www.chamas.com/hello_world.html , 
you should factor that into your decision.  It comes in only 
slightly slower for HelloWorld than Embperl & Registry, about 
20% on Solaris, and is about 20% faster than the last Mason 
release benched.

The URL for Apache::ASP is http://www.nodeworks.com/asp/

-- Joshua
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

Reply via email to