velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: Most efficient evaluation
Date Sat, 04 Feb 2012 16:44:51 GMT
On Sat, Feb 4, 2012 at 7:58 AM, Chad La Joie <lajoie@itumi.biz> wrote:
> I'm looking for the most efficient/performant way to evaluate a
> template and have some questions surrounding this.
>
> 1. Are Template objects reusable and thread safe?  If they're just
> ASTs, it seems like they should be.

Yes, but you shouldn't have to directly interact with Template
objects, because...

> 2. Does the Velocity/VelocityEngine class cache compiled templates (as
> Template objects or anything else)?

... they are handled (and yes, cached, if you want) internally.  You
just turn caching on.  See User's Guide for more info.

> 3. If yes to both above, is there really any difference between
> calling Velocity[Engine].merge and Template.merge?

Mostly in that VelocityEngine is the API users are expected to use and
Template is really much more of an "internal" class for advanced
purposes.

> Thanks.
>
> --
> Chad La Joie
> www.itumi.biz
> trusted identities, delivered
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message