On Tue, Mar 9, 2010 at 9:17 AM, Jason Tesser <[email protected]> wrote:
> Can you help me understand the performance difference between
> 1. from Velocity calling #parse

first calls out to the resource loader system to find the referenced
template (which may or may cache it on first call, depending on your
loaders).  Oh, and this also may have to run through an
IncludeEventHandler.   Then it goes on to render the template into the
parent writer.  Other differences are pretty negligible.

> 2. doing a template.merge()

Faster, mostly because you already have an init'ed template
(search/parse/cache/init already happened presumably).  And no
possibility of an IncludeEventHandler.

> If I have a page that parses a bunch of VTLs which parse others and so forth
> is it faster to do that all as a merge and not a parse.

Assuming all else is equal (context handling and whatnot), then, yes,
it should be slightly faster.

> We are seeing lots of different memory issues related to Velocity and I
> wonder if Introspection is killing us. I was hoping one of the devs here
> would have some idea.

There are so many configuration possibilities for Velocity that it is
hard to say.  Introspection is generally not a major bottleneck, so
long as you are not constantly creating new VelocityEngines (thus
ditching the ClassMap).   Memory problems were rather endemic in
Velocity 1.5, particularly where Velocimacros were concerned.  That
was fixed in 1.6.  But you would really need to profile and/or explain
more about your configuration and the nature of your templates to get
better help.

>
> Thanks,
> Jason Tesser
> dotCMS Lead Development Manager
> 1-305-858-1422
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to