Heads up. I need to investigate the exact cause, but applying Jarkko patch
(velocity-1.6-dev-macro-performance-IDEAS-v2.5.patch) I'm getting OOM errors
now. Unfortunately, I've had to revert to get a project going.  Soon, I'll
download trunk and re-test and profile if I run across the issue again. My
application is pretty straightforward. I'm extending VelocityViewServlet and
serving up a basically static website. So if someone wants to test, I would
create 20 templates with an external macros file that is added using
template.merge(context,
writer, templates). No heavy load needed. Just navigate through the
templates (with caching turned on) fairly quickly.

On oddity I did notice is that my status page which determines the total
amount of memory allocated (Runtime.*getRuntime*().totalMemory() ) and the
amount of free memory left, indicated that at some point the allocated
memory was reduced. I thought this was strange.

Anyways, this is probably not enough info to point to what the issue is, but
when I get chance to profile, I'll give more details.

Thanks,

Erron
On Wed, Aug 13, 2008 at 2:33 AM, Nathan Bubna (JIRA) <
dev@velocity.apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/VELOCITY-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Nathan Bubna resolved VELOCITY-607.
> -----------------------------------
>
>    Resolution: Fixed
>
> Ok, marking this resolved.  Jarkko, feel free to re-open if i missed
> something or messed up something.  I think i got it all though.  Performance
> looks much better in my testing too.
>
> Now, with all these changes, it's probably time for a beta release to
> encourage people to start kicking the tires and make sure we didn't change
> something important...
>
> > 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-dev-macro-performance-IDEAS-v2.6.patch,
> velocity-1.6-dev-macro-performance-IDEAS-v2.7.patch,
> velocity-1.6-head-20080725-velocity24-test.PNG
>  >
> >
> > 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to