GSP and GroovyPageOutputStack.push()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

GSP and GroovyPageOutputStack.push()

Daniel Henrique Alves Lima
        Hi, everybody.

        When testing the usage of Grails Dynamic Tag Libraries in FreeMarker
templates, i've faced the following scenario:

        70% of the execution time seems consumed by tagLib.setProperty(out, ?).
        It triggers

            mc.setOut = {Writer newOut ->
       
        GroovyPageOutputStack.currentStack().push(newOut,true)
                    }
       
                inside GroovyPagesGrailsPlugin.groovy



        Tag execution through FreeMarker is responsible for only 30%.   How can
i improve GroovyPageOutputStack usage here
https://code.google.com/p/grails-freemarker-tags-plugin/source/browse/trunk/src/groovy/org/codehaus/groovy/grails/plugins/freemarker/DynamicTagLibDirective.groovy ?
(the code was inspired in JspInvokeGrailsTagLibTag.java)

        I really believe this is causing the difference of performance observed
between FTL and GSP.

        Thanks in advance!

        The original thread (with profiler information included):

http://grails.1312388.n4.nabble.com/FreeMarker-vs-GSP-for-Dynamic-Template-Rendering-tp3213939p3219595.html


        The test case:

http://freemarker.624813.n4.nabble.com/Possible-room-for-performance-improvement-when-using-TemplateDirectiveModel-and-TemplateMethodModelEx-tp3217295p3219604.html



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GSP and GroovyPageOutputStack.push()

Daniel Henrique Alves Lima
        Yes, i'm aware this is just a micro-bench.
        I've tested Lari's version again:

http://grails.1312388.n4.nabble.com/FreeMarker-vs-GSP-for-Dynamic-Template-Rendering-tp3213939p3214347.html

        In GSP execution, setProperty don't even show:

http://grails-freemarker-tags-plugin.googlecode.com/files/gsp_call_tree.png
http://grails-freemarker-tags-plugin.googlecode.com/files/gsp_call_graph.png

        But in FTL execution:

http://grails-freemarker-tags-plugin.googlecode.com/files/call_tree_freemarker_tags.png
http://grails-freemarker-tags-plugin.googlecode.com/files/call_graph_freemarker_tags.png


        That's why i'm suspecting of the indirect usage of
GroovyPageOutputStack.push() in FreeMarker Tags plugin implementation.
       

        But i'm not an expert in GSP or FreeMarker.

        Thanks.

        Best regards,

                Daniel.


# FreeMarker 1000 times completed in 314128ms.
# GSP 1000 times completed in 13683ms.

Files are here:

http://grails-freemarker-tags-plugin.googlecode.com/files/grails-freemarker-tags-0.5.6.zip
http://grails-freemarker-tags-plugin.googlecode.com/files/freemarker-vs-gsp.tar.bz2



On Sun, 2011-01-16 at 01:05 -0200, Daniel Henrique Alves Lima wrote:

> Hi, everybody.
>
> When testing the usage of Grails Dynamic Tag Libraries in FreeMarker
> templates, i've faced the following scenario:
>
> 70% of the execution time seems consumed by tagLib.setProperty(out, ?).
> It triggers
>
>             mc.setOut = {Writer newOut ->
>        
>         GroovyPageOutputStack.currentStack().push(newOut,true)
>                     }
>        
>                 inside GroovyPagesGrailsPlugin.groovy
>
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GSP and GroovyPageOutputStack.push()

Daniel Henrique Alves Lima
        I think i've got it:

http://grails-freemarker-tags-plugin.googlecode.com/files/grails-freemarker-tags-0.5.7.zip
https://code.google.com/p/grails-freemarker-tags-plugin/source/browse/trunk/src/groovy/org/codehaus/groovy/grails/plugins/freemarker/DynamicTagLibDirective.groovy



On Sun, 2011-01-16 at 10:56 -0200, Daniel Henrique Alves Lima wrote:
> Yes, i'm aware this is just a micro-bench.
> I've tested Lari's version again:
>
> http://grails.1312388.n4.nabble.com/FreeMarker-vs-GSP-for-Dynamic-Template-Rendering-tp3213939p3214347.html
>

(...)


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GSP and GroovyPageOutputStack.push() [SOLVED]

Daniel Henrique Alves Lima