velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Wilson" <andrew.wil...@db.com>
Subject Performance Question.
Date Fri, 10 Dec 2004 05:42:41 GMT
Im using Velocity to render a relatively complex template (about 100
substitutions).  Its working really nicely, but Im trying to optimise
performance.

Its taking about 50ms to render the template, but I was hoping I could
improve that by turning on caching.  Ideally Id like to load the templates
from the classpath, but when that didn't work I used the File version,
just to try and get some improvement.  I initted Velocity accordingly -

Properties p = new Properties();
p.setProperty("resource.loader","file");
p.setProperty("file.resource.loader.class",
"org.apache.velocity.runtime.resource.loader.FileResourceLoader");
p.setProperty("file.resource.loader.cache", "true");
Velocity.init(p);

Then I render my template using the following code :

VelocityContext context = new VelocityContext();
context.put("allRequests", allRequests);
/* lets render a template */
Velocity.mergeTemplate("xml/Template.xml", context, result );

Caching doesn't seem to make things any faster and I get the feeling Im
doing something fundamental wrong.

Apologies that this is a bit of a newbie question, but Ive read the
support group etc. and I just cant get any optimisation.  

Kindest regards,
Andrew.

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


Mime
View raw message