velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Locke" <plo...@abebooks.com>
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
stream.

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

Peter

-----Original Message-----
From: Twan Kogels [mailto:twan@twansoft.com] 
Sent: Wednesday, June 16, 2004 4:31 AM
To: velocity-user@jakarta.apache.org
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 -
org.apache.velocity.servlet.VelocityServlet.mergeTemplate()
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
statements.

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
faster?

Thanks!
twan


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


---------------------------------------------------------------------
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