7
回答
【转】Play, Rails, Wicket, Grails, Tapestry, Lift, JSP, Context 性能比较
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

This post shows how to render a list of product objects with associated category object using the webframeworks Rails, Wicket, Grails, Play, Tapestry, Lift, Context and JSP/Servlets. I’ve also benchmarked theresponse times.

INTRODUCTION

More »

METHODS

More »

Framework: JSP, JSTL, Servlets

Specs:
-JSP 2.1
-JSTL 1.2
-Servlet 2.5

More »

Framework: Wicket

Specs:
-Wicket 1.5-RC3

Because of a bug ( https://issues.apache.org/jira/browse/WICKET-3740 ) in Wicket, which might impact performance, Wicket is also tested for the latest snapshot version of Wicket from trunk for 1.5-RC3. (Called “Wicket-trunk” in the test results.)

More »

Framework: Grails

Specs:
-Grails 1.3.7
-Grails 1.4.0.M1

More »

Framework: Ruby On Rails

-Ruby 1.9.2-p180
-Rails 3.0.7
-WEBrick 1.3.1 (webserver)
-mongrel 1.2.0.pre2 (webserver)
-JRuby 1.6.2
-Trinidad 1.2.0 (embedded Tomcat for JRuby)

More »

Framework: Play

Specs:
-Play 1.2.1

More »

Framework: Lift

Specs:
-Lift 2.3
-Scala: 2.8.1

More »

Framework: Play-Scala

Specs:
-play-1.2.2RC1
-play-scala-0.9.1

More »

Static file test

The static file test is rendering of plain HTML files served directly by the webserver (Tomcat). So no framework was used in this test.

Test Results

Note: that the more component based frameworks – such as Wicket and Lift – have multiple ways of doing things. Where the simpler MVC push frameworks – such as Rails, JSP, Play, Grails – usually have one way of doing it. Therefore, because there are multiple solutions in Wicket and Lift, there may be faster (and slower) solutions than I have used. However, I did try to use common solutions.

Wicket-1.5rc3 and Wicket-1.5r5trunk use a ListView to iterate over the categories, but Wicketb-1.5rc5trunk uses a RepeatingView.

More »

Test Remarks

CPU Utilization is inaccurate
More »
Rails
More »
Lift
More »
Wicket
More »
Tapestry
More »
Effects of page size by unneeded whitespaces
More »
JMeter

JMeter impacts the test results. This might be due to JMeter using RAM or CPU. I should retest the tests with JMeters Distribution Graph disabled.

Package sizes

grails.war, 22.088kb
jsp.war, 375kb
lift.war, 14.111kb
play.war, 29.124kb
playscala.war, 53.119kb
wicket.war, 2.200kb

Discussion

What suprised me is that even though JSP/JSTL, Rails, Grails and Play use about the same MVC model, the differences in performance are big. Simply switching from template system in Play framework from the default to Japid, has a huge impact (in this test 27 times faster).

Most posts about JRuby on Rails tell that it is faster than Ruby on Rails, however in this test, Ruby on Rails was clearly faster in both the rendering of products and concurrent-user test.
Also, most posts about Rails tell that Webrick is slower than Mongrel, but in this test, Webrick was a bit faster.
JRuby on Rails running on Trinidad does perform faster than other Rails configurations when tested with concurrent users.

Play-Scala using Netty NIO server is faster than Tomcat webserver. I wouldn’t expect the differences to be that big. It’s unclear whether these fast results are caused by Play-Scala being optimized for Netty, or that Netty is simply faster than Tomcat (and thus that other frameworks could also have faster results under Netty).
Note that the memory usage of Play-Scala under Netty is a lot higher than under Tomcat.

The section “Effects of page size by unneeded whitespaces” shows that unneeded whitespaces impact the response time. Frameworks can probably be optimized by stripping unneeded whitespaces from the templates during boot, even when HTTP gzip compression is enabled. (During the test, compression was disabled in Tomcat and Netty.)

Questions

-Does anybody know why the static file test under Tomcat is using so much memory?

Blog post updates

-30 May 2011: Added Play-scala (under Tomcat webserver) and Play-scala-netty (under Play’s builtin Netty webserver). Added the effects of unneeded whitespaces. Added Wicket-trunk, which is the latest Wicket snaphot from trunk (for 1.5-RC5), and info about a performance bug in Wicket.
-31 May 2011: Added Play-Japid and JRails.
-3 June 2011: Added Grails trunk.
-13 June 2011: Added Tapestry, Context-framework and Grails-1.3.7-freemarker

Project files

The files (code, project, html) of this post can be found here: https://github.com/jtdev/blogpost_files

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

举报
老盖
发帖于6年前 7回/4K+阅
顶部