micro bench: FTL vs. GSP

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

micro bench: FTL vs. GSP

Daniel Henrique Alves Lima
    Hi, everybody.

    In this post about a micro benchmark
(http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp), I
suggested FreeMarker templates as an alternative
(http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp/comment-page-1/#comment-22088)
because, in my tests, FreeMarker seems really faster for this particular
case
(http://grails.1312388.n4.nabble.com/Template-GSP-vs-FTL-td3578664.html).
    But as a developer, I learned to always double check my tests and
suspicious of any big differences in them.

    I must be unbiased here: Do you see any particular reason for
FreeMarker performs so fast? My .ftl templates are here:
   
https://github.com/daniel-lima/blogpost_files/tree/master/grailsapp-fm-1.3.7/grails-app/views

    I also wondered about some weird bug that I might have accidentally
introduced (some thread issue?) to make FreeMarker seems faster than it
really is:
   
http://code.google.com/p/grails-freemarker-tags-plugin/source/browse/#svn%2Ftrunk

    I'm just checking to see if there is any obvious problem in my
tests. I'm also waiting for "official" results:
http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp.


    Thanks in advance.

          Best regards,

                Daniel.


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: micro bench: FTL vs. GSP

Daniel Dekany
Assuming the output from the FTL version is correct, it's certainly
more expedient to check with a profiler where GSP spends that extra
time. Anyway, since Groovy is a full-blown programming language, and
GSP is translated to Groovy (right?), I can imagine it comes with more
overhead that starts to dominate for simple short-running programs.

How many records are there in that HSQL database? What's if you
display much more entries? Just in case the HSQL performance starts to
dominate, what if you take HSQL out of the equation and use a plain
Java list?

--
Best regards,
 Daniel Dekany


Tuesday, June 7, 2011, 2:28:34 PM, Daniel Henrique Alves Lima wrote:

>     Hi, everybody.
>
>     In this post about a micro benchmark
> (http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp), I
> suggested FreeMarker templates as an alternative
> (http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp/comment-page-1/#comment-22088)
> because, in my tests, FreeMarker seems really faster for this particular
> case
> (http://grails.1312388.n4.nabble.com/Template-GSP-vs-FTL-td3578664.html).
>     But as a developer, I learned to always double check my tests and
> suspicious of any big differences in them.
>
>     I must be unbiased here: Do you see any particular reason for
> FreeMarker performs so fast? My .ftl templates are here:
>    
> https://github.com/daniel-lima/blogpost_files/tree/master/grailsapp-fm-1.3.7/grails-app/views
>
>     I also wondered about some weird bug that I might have accidentally
> introduced (some thread issue?) to make FreeMarker seems faster than it
> really is:
>    
> http://code.google.com/p/grails-freemarker-tags-plugin/source/browse/#svn%2Ftrunk
>
>     I'm just checking to see if there is any obvious problem in my
> tests. I'm also waiting for "official" results:
> http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp.
>
>
>     Thanks in advance.
>
>           Best regards,
>
>                 Daniel.
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> FreeMarker-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: micro bench: FTL vs. GSP

Daniel Henrique Alves Lima
In reply to this post by Daniel Henrique Alves Lima
        Hi, Daniel. Thanks for your help!

        I have no idea if GSPs are translated to Groovy. Most of the
time I use FreeMarker or JSP... :-/
        There are only 4 differences between
https://github.com/daniel-lima/blogpost_files/tree/master/grailsapp-fm-1.3.7
and https://github.com/daniel-lima/blogpost_files/tree/master/grailsapp-1.3.7
:

- application.properties
- grails-app / conf / Config.groovy
- grails-app / views / products / index.gsp (index.ftl)
- grails-app / views / shared / _product.gsp (_products.ftl)


        So anything odd in the GSP version will be equally odd in the
FTL version :-)

        The database is initially empty and I think (I'm away from my
computer right now) it remains empty. The data are created here:

https://github.com/daniel-lima/blogpost_files/blob/master/grailsapp-fm-1.3.7/src/java/s/Service.java

        I'm not sure why the author took this approach, but...


        The products will be loaded here:

https://github.com/daniel-lima/blogpost_files/blob/master/grailsapp-fm-1.3.7/grails-app/controllers/grailsapp/ProductsController.groovy


        right before the rendering of index.ftl.


        I usually don't care much about micro benchmarking, but
FreeMarker has outperformed GSP and this make me wonder if I could
have introduced a nasty bug in freemarker-tags.


        Best regards,

                Daniel.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: micro bench: FTL vs. GSP

Daniel Henrique Alves Lima
JMeter results:

http://techdm.com/grails/?p=445&lang=en

Daniel Henrique Alves Lima wrote:
>         Hi, Daniel. Thanks for your help!
>
>        (...)
>  

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel
Reply | Threaded
Open this post in threaded view
|

Re: micro bench: FTL vs. GSP

Daniel Henrique Alves Lima
    FreeMarker+Grails results published as grails-1.3.7-fm.

http://www.jtict.com/blog/rails-wicket-grails-play-lift-jsp/

    I'm aware it is just a micro benchmarking, but FreeMarker did a nice
job! Well done!

    Best regards,

          Daniel.


Daniel Henrique Alves Lima wrote:

> JMeter results:
>
> http://techdm.com/grails/?p=445&lang=en
>
> Daniel Henrique Alves Lima wrote:
>  
>>         Hi, Daniel. Thanks for your help!
>>
>>        (...)
>>  
>>    
>
>  

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel