[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-dev
Subject:    Re: [jira] Commented: (VELOCITY-607) Runtime macro rendering very slow in Velocity 1.6-dev (679708)
From:       "Erron Austin" <erron.austin () gmail ! com>
Date:       2008-07-31 20:27:47
Message-ID: e5ec51950807311327j59797ea6y18f3b3da202c9517 () mail ! gmail ! com
[Download RAW message or body]


Ok then, my question would be, could you not check to see if the text has
changed before reparsing it into AST?

(I also have very little knowledge of the inner workings of Velocity)

On Thu, Jul 31, 2008 at 4:20 PM, Will Glass-Husain (JIRA) <
dev@velocity.apache.org> wrote:

> 
> [
> https://issues.apache.org/jira/browse/VELOCITY-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618841#action_12618841]
>  
> Will Glass-Husain commented on VELOCITY-607:
> --------------------------------------------
> 
> Simple answer.  It's because #parse is executed at runtime.  Since macros
> can be loaded in a parsed file, the specific macro might change each time
> the page is rendered.
> 
> > Runtime macro rendering very slow in Velocity 1.6-dev (679708) compared
> to 1.5
> > 
> ------------------------------------------------------------------------------
> > 
> > Key: VELOCITY-607
> > URL: https://issues.apache.org/jira/browse/VELOCITY-607
> > Project: Velocity
> > Issue Type: Bug
> > Components: Engine
> > Environment: Maven 2, JUnit, JUnitPerf, JRat, custom testbench:
> http://www.iki.fi/wyla/velocity/testbench
> > Reporter: Jarkko Viinamäki
> > Priority: Critical
> > Fix For: 1.6
> > 
> > Attachments: velocity-1.5-velocity24-test.PNG,
> velocity-1.6-head-20080725-velocity24-test.PNG,
> velocity-1.6-macro-performance-IDEAS.patch
> > 
> > 
> > The following test template (see VELOCITY-24):
> > ## local macro, not global
> > #macro(letter $char)
> > This is the letter $char
> > #end
> > #letter("A")
> > #letter("B")
> > #letter("C")
> > #letter("D")
> > #letter("E")
> > #letter("F")
> > #letter("G")
> > #letter("H")
> > #letter("I")
> > #letter("J")
> > #letter("K")
> > #letter("L")
> > #letter("M")
> > #letter("N")
> > #letter("O")
> > #letter("P")
> > #letter("Q")
> > #letter("R")
> > #letter("S")
> > #letter("T")
> > #letter("U")
> > #letter("V")
> > #letter("W")
> > #letter("X")
> > #letter("Y")
> > #letter("Z")
> > ---
> > Works quickly and correctly with Velocity 1.5 with several concurrent
> threads. However, 1.6-dev is a LOT slower (even 20x).
> > The major performance bottlenecks seem to be:
> > RuntimeMacro.render (60% of time)
> > VelocimacroFactory.getVelocimacro (20% of time)
> > With several threads this test also causes Velocity to throw error(s):
> > org.apache.velocity.exception.MacroOverflowException: Exceed maximum 20
> macro calls. Call Stack:letter->letter->letter->letter->letter
> > at
> org.apache.velocity.runtime.VelocimacroFactory.startMacroRendering(VelocimacroFactory.java:179)
> 
> > at
> org.apache.velocity.runtime.RuntimeInstance.startMacroRendering(RuntimeInstance.java:1693)
> 
> > at
> org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:200)
> 
> > at
> org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
> > at
> org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:178)
> > at
> org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:323)
> > at org.apache.velocity.Template.merge(Template.java:324)
> > at org.apache.velocity.Template.merge(Template.java:232)
> > at
> org.apache.velocity.test.load.Velocity24Test.testRendering(Velocity24Test.java:51)
> > This is related to VELOCITY-297 but the fix doesn't seem work with the
> new modified macro implementation.
> 
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
> 
> 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic