velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Locke" <>
Subject RE: A more efficient velocity template?
Date Wed, 16 Jun 2004 16:27:04 GMT
I also profile my code heavily, and Velocity 1.4  provided a good speed
increase over 1.3.x.  I use velocity servlets in a high demand situation
(well over a million hits per day) and with 1.4 the increase in CPU usage on
the appservers is negligible in comparison to writing raw HTML to the output

In addition, make sure your macros themselves are efficient, and I suggest
moving business logic into the java code where possible.


-----Original Message-----
From: Twan Kogels [] 
Sent: Wednesday, June 16, 2004 4:31 AM
Subject: A more efficient velocity template?

Hello people,

I'm currently in the process of making a webapplication a bit faster. I use a
profiler to look at my code and see where possible bottlenecks are.

I found out that velocity is parsing a template relative slow:
62.38% - 854 ms -
35.35% - 484 ms - kaart.KaartController.handleRequest()

The "handleRequest()" (second line) is my custom code making queries and
doing logic. The "mergeTemplate()" seems to be velocity parsing and filling
the template.

The template is a complex one with a lot of custom macro's and if and else

I'm currently using velocity 1.3.1.

Are there a documents/urls/tips available which discuss or give tips
regarding on how to construct efficient templates or make velocity a bit


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message