Re: Possible room for performance improvement when using TemplateDirectiveModel and TemplateMethodModelEx
Daniel Henrique Alves Lima <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Daniel, the tests are running the following template 10.000 times:
[#ftl/]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
[#assign entityName][@g.message code="test1.label"
default="Test1" /][/#assign]
[#assign entityName][@g.message code="test1.label"
default="Test1" /][/#assign]
[#assign entityName][@g.message code="test1.label"
default="Test1" /][/#assign]
<!-- ${entityName} -->
</head>
</html>
It takes 20-30 seconds. GSP is doing something equivalent in 4-6
seconds, but this doesn't make any sense: Save a minor overhead, they
are both calling the same compiled code to get the job done.
Something is very odd, but to me FreeMarker doesn't seem the root of
the problem (i really need a better profiler :-/):
http://grails.1312388.n4.nabble.com/FreeMarker-vs-GSP-for-Dynamic-Template-Rendering-tp3213939p3219595.html
Thanks!
On Sat, 2011-01-15 at 21:22 -0200, Daniel Henrique Alves Lima wrote:
> Hi, Daniel.
>
> I'm not sure (yet). I believe FreeMarker performance should be close to
> GSP performance in this case. FreeMarker is performing worse by a large
> factor. I'm trying to discover if Tags plugin has something to do with
> it.
>
> Thanks.
>
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl