You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2002/10/09 11:31:25 UTC
simple matchers to reduce overhead
> > btw: do we already have an "always" matcher?
> > due to the lastest performance analysis we should better
> > substitute
> >
> > <map:match pattern="*"> or <map:match pattern="**">
> >
> > with
> >
> > <map:match type="always">
>
> Well, you might end up with Matchers like
>
> <map:match type="startsWith" pattern="foo">
>
> or
>
> <map:match type="endsWith" pattern="bar">
>
> for performance reasons and the numbers of Matchers will exponantially
> grow.
...well, could you really think of more? If I look into our sitemaps those are
the most widely used ones. All other would be regexpr / wildcard.
I don't think it's that bad... If I can really save that amount of per-request
processing time - I would go for it!
We could also modify the WildcardMatcher and hardcode some patterns instead...
pattern="**"
pattern="**something"
pattern="something**"
would be interesting to see the impact on performance...
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: simple matchers to reduce overhead
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Torsten Curdt wrote:
> ...well, could you really think of more? If I look into our sitemaps those are
> the most widely used ones. All other would be regexpr / wildcard.
>
> I don't think it's that bad... If I can really save that amount of per-request
> processing time - I would go for it!
I wouldn't recommend to do this because:
> We could also modify the WildcardMatcher and hardcode some patterns instead...
This is indeed the way to go: automatically recognize patterns instead of
bothering the user to do it manually.
I'd go even farther and try to build a DFA for
<map:match pattern="foodir/**html">
...
</map:match>
<map:match pattern="bardir/**html">
...
</map:match>
the same way lexers do. In the example above, you can decide where to go
after examining *one* character...
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org