velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caleb Jones" <calebjo...@gmail.com>
Subject Re: Caching for VelocityEngine's evaluate(VelocityContext, Writer, String, String) method?
Date Tue, 06 Jan 2009 17:41:47 GMT
Thanks for the tip Erik.  I, however, decided to go with upgrading to 1.6.1
since there are other optimizations and bug fixes I'd like to have.

By the way of informal benchmarking, by simply dropping in 1.6.1 (as well as
the dependent commons-collections and commons-lang) I noticed my velocity
rendering went from ~35ms per call to evaluate() to ~8ms per call to
evaluate() (which no longer makes velocity the bottleneck).  I have not yet
refactored code to use the suggested StringResourceLoader.  I'll post more
informal benchmarks when/if I do that.

On Tue, Jan 6, 2009 at 3:49 AM, Erik Hatcher <erik@ehatchersolutions.com>wrote:

>
> On Jan 5, 2009, at 6:49 PM, Caleb Jones wrote:
>
>  Thanks.  That's exactly what I need.  Sorry, I didn't mention that I was
>> working under velocity 1.5.  I'll upgrade to 1.6.1.
>>
>
> You don't need to upgrade to get a "String" resource loader if you don't
> mind coding a little custom one.  Here's an example of pulling templates
> from an HTTP request (indirectly, through Solr's infrastructure):
>
>        <
> http://svn.apache.org/repos/asf/lucene/solr/trunk/contrib/velocity/src/main/java/org/apache/solr/request/SolrParamResourceLoader.java
> >
>
> Maybe I should be using the new StringResourceLoader though.
>
>        Erik
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message