Play! is an excellent Web framework which is quite similar to Spring MVC on the view/controller aspect and is using Groovy as the view technology.
Spring usual views (JSP, JSTL, Freemarker, Velocity) are quite outdated and I do not understand why Spring does not improve them and why Matt Raible set their as a "pro" in his comparaison.
I believe in using the Grails View as the Spring MVC View. See my previous article about the "How To" and according to the Spring MVC roadmap, Grails View support will be added to Spring 3.1.
Let's benchmark Play! vs Spring MVC with Grails View. This microbenchmark will focus only on the view/controller performance.
Test setup
Computer
- Core 2 Duo @ 3Ghz
- 6GB RAM
- Windows 7
Frameworks used
- Play! 1.2 (standard configuration, production)
- Spring 3.1.0 M1 (production)
- Tomcat 7.0.12 (standard configuration, BIO) launch with CATALINA_OPTS equals to "-server -Xmx1024m"
Scenarii
The scenarii are the following :- An empty controller rendering a simple view
- A parametrized controller with validation rendering a simple view. I reused a Play! controller from their Yabe tutorial
- A search controller rendering a complex view. I reused the Subbu benchmark sources
I run the Spring webapp on Tomcat 7 and I run the Play! webapp on Tomcat 7 and on the embeded server. I used the Apache HttpComponents toolkit to request the servers.
Project
The Spring project is available on github.Empty controller
Spring Controller
Play Controller
The view
Result
Parametrized controller
Spring Controller
Play Controller
The view
Result
Search controller
"results" is a Json object loaded at startup. This Json contains the results of an Ebay search request. See the Subbu's article for more info.Spring Controller
Play Controller
The view
I reused the view template of the Subbu project . The Grails View is quite similar.Result
Conclusion
- Play! is 25% ahead of Spring on the empty controller test.
- Spring is 20% ahead of Play! as soon as there is request's parameters.
- Spring is 70% ahead of Play! on the search test. The gap is quite important.
The most revelant test is the last one. Grails template engine is definitively more optimized than Play! template engine. As Play! and Grails used both Groovy, Play! template engine can clearly be improved.
Another interesting fact is that Play! with Tomcat (BIO) performs better than Play! embedded server ie. Netty (NIO). I don't know why, explanations are welcome!
A rather important things you left undisclosed: your actual benchmarking scripts, jvm arguments, component making the requests.
ReplyDeleteThese benchmarks sure sound like the perfect ones for blocking IO connector (BIO). Also, was Connection: keep-alive used? The reason I think these are perfect for BIO is that you have a very short "actual logic part", whereas if your code would do database lookups, anything requiring even more blocking it might have beneffited the jetty NIO.
Is the "thread" parameter of your graphs the server or client side threads? If client side, what kind of was the server side configuration?
I used the standard Tomcat configuration which is available here (The maxKeepAliveRequests is set to 100). I do not modify Play! configuration too.
ReplyDeleteThe component making the request used Apache HttpComponents with a simple "start time, request, end time, compute the delta" pattern.
I can put the source on github on demands.
Note : Play! used Netty not Jetty anymore.
what's the load generator and at what concurrency?
ReplyDeleteVery nice - thanks for this!
ReplyDeleteCould you open source what you used to test this or even better do the same with a simple grails setup
would love to see how that performs vs this mix.
I have put the project on Github.
ReplyDeleteThe Play! project will follow after my vacation.
Nice article , you have indeed covered topic in details with sample code and graphics, its indeed a topic which require a deeper understanding than many other java topics.
ReplyDeleteJavin
How Garbage collection works in Java
Thanks for this great article
ReplyDeleteExtreme Java
Grails 1.4 brings a lot of performance tweaks : compile-time injection, GSP optimization to statically calls output methods, singleton scoped controllers, use of methods instead of closures... I hope to see better results for this test and similar ones by using the Grails groovy controllers.
ReplyDeleteInteresting way of use by the way.
Thanks pred for this information.
ReplyDeleteI will test with Grails 1.4 GSP and with Grails controllers.
I like both grails as well as play, but I started working with play more coz when I check the memory footprint, I realize with grails I will have to pay atleast 6 times more than play framework. Although play view is little slower, it is more easier to work with than grails gsp. I also remember the initial days of grails when it was getting slammed from every quarter for the slowness of GSP, I hope play will get better in this area in upcoming releases.
ReplyDeleteHi,
ReplyDeletewith the new scala template system (can be ported to java in future release) there is no performance penalty now because of groovy templating. If you benchmark it with this new system there probably be huge speed improvements.
http://groups.google.com/group/play-framework/browse_thread/thread/cab3a12178bea69c
Hi Anonymous,
ReplyDeleteI will update as soon as Grails 1.4 will be updated.
Grails 1.4 will contain GSP improvment.
Here is another benchmark for template rendering performance of Play! :
ReplyDeletehttp://code.google.com/p/cambridge/wiki/UsingWithPlayFramework
I'd love to see these benchmarks again using Play 2.0 (which uses Scala compiled templates)! Should be considerable speed increases seen here (and the integrated web server, providing it's running in prod mode, should speed things up further)
ReplyDeleteAs soon as content comes to the seen, long term objects make gc tasks dificult. Play static controllers are a "easy" "hack" for concurrency problems and reflection performance but all that comes with a heavy price app mem foot print becomes way to big. You can easly check this if you check the early versions of play you would see multiple concurrency problems. Play is nice idea but not somethin you use for real projects.
ReplyDeleteSparkinfosys is One Of the Best Designing and Development Company in Hyderabad.We offer Creative Website Design, Website Development, E-commerce Services, SEO Services, mobile app development ,Android App Development ,Matrimonial we designing company,Logo Designing,BULK SMS SERVICES,Domain Registration...etc
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteRealTrainings is providing IT and Non IT training institutions information in hyderabad,chennai,bangalore and etc..So that IN realtrainings, the students can compare institutions with full detailed course information and can choose best institute for learning course what you wish .
ReplyDeleteI have ever read such a nice blog and you made a good effort to wrote this.
ReplyDeletei request you to update such kind of data on your wall.
PHP Training in Chennai
DOT NET Training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
Android Training in Chennai
Selenium Training in Chennai
Digital Marketing Course in Chennai
JAVA Training in Chennai
German Language Course in Chennai
German Classes in Chennai
German classes in Annanagar
Велике спасибі за поділ цієї цікавої статті!
ReplyDeletelưới chống chuột
cửa lưới dạng xếp
cửa lưới tự cuốn
cửa lưới chống muỗi
Phối chó bull pháp
ReplyDeletePhối giống chó Corgi
Phối chó Pug
chó Poodle
chó Poodle giá bao nhiêu
Harika bir makalen var. Verimli bir gün diliyorum
ReplyDeletebon ngam chan
máy ngâm chân giải độc
bồn mát xa chân
chậu ngâm chân giá rẻ
This comment has been removed by the author.
ReplyDeleteVanskeligheter( van bi ) vil passere. På samme måte som( van điện từ ) regnet utenfor( van giảm áp ) vinduet, hvor nostalgisk( van xả khí ) er det som til slutt( van cửa ) vil fjerne( van công nghiệp ) himmelen.
ReplyDeleteWell, do! recently I saw your pretty post and It is good with useful details. Thank you...
ReplyDeletePlacement Training in Chennai
Best placement Training institutes in Chennai
Power BI Training in Chennai
Job Openings in Chennai
Pega Training in Chennai
Soft Skills Training in Chennai
JMeter Training in Chennai
Tableau Training in Chennai
Appium Training in Chennai
Placement Training in Porur
Placement Training in Anna Nagar
http://www.google.sr/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
ReplyDeletehttp://www.google.ad/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.com.bh/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.com.bo/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
http://www.google.co.bw/url?q=https://forums.futura-sciences.com/members/1080064-thanhgompaumaieco.html
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for sharing this information ...Here in Sarkari Naukri section Sarkari Job can search & apply online for various jobs & information like PSU, PSC, SSC, Army, Navy, Railway etc. We also list all the Todays Sarkari Jobs 2018, central and state government jobs, Public sectors jobs, latest Bank jobs, Defence Jobs, Diploma Sarkari naukri across India.
ReplyDeleteCloud Timon is the best Web Designing & Web Development Company in Hyderabad and offers Website Designing Services, Web Development Service, Digital Marketing Services, eCommerce Web Development Services, SEO Services, Mobile Application Development Services, Android App Development, Matrimonial Websites, Hospital Management Systems, News Portals & custom Web applications.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for sharing the comprehensive post, your post having informative&valuable content,it will be helpfull. |
ReplyDeleteWeb Development Company in Hyderabad
GD Goenka Signature School is a premium CBSE affiliated day, weekly and full boarding school. It is located on a sprawling 20 acre campus on Sohna Road, Gurgaon, just 60 minutes away from the New Delhi airport. Parents, visitors and the community are already claiming it to be way ahead of most schools in India, including most international schools. This is largely due to it’s advanced Real World CurriculumTM, the premium infrastructure to support the curriculum and the well-trained mentors who are currently working with students to deliver amazing results.
ReplyDeleteboarding school in india!
Thanks for sharing the comprehensive post, your post having informative&valuable content,it will be helpfull. |
ReplyDeleteAugmented Reality Development Companies in India
ReplyDeleteThanks for sharing the comprehensive post, your post having informative&valuable content,it will be helpfull. |
Advertising Agency in Hyderabad
Informative blog! it was very useful for me.Thanks for sharing. Do share more ideas regularly.
ReplyDeleteVillage Talkies a top-quality professional corporate video production company in Bangalore and also best explainer video company in Bangalore & animation video makers in Bangalore, Chennai, India & Maryland, Baltimore, USA provides Corporate & Brand films, Promotional, Marketing videos & Training videos, Product demo videos, Employee videos, Product video explainers, eLearning videos, 2d Animation, 3d Animation, Motion Graphics, Whiteboard Explainer videos Client Testimonial Videos, Video Presentation and more for all start-ups, industries, and corporate companies. From scripting to corporate video production services, explainer & 3d, 2d animation video production , our solutions are customized to your budget, timeline, and to meet the company goals and objectives.
As a best video production company in Bangalore, we produce quality and creative videos to our clients.
watching top school in Haryana for your child's admission? Shri Krishna Top School In Mahendergarh focuses on mental and physical development, good education for children
ReplyDeleteVery interesting, good job and thanks for sharing such a good blog. Your article is so convincing that I never stop myself to say something about it. You’re doing a great job. Keep it up web development company in Hyderabad
ReplyDeleteThanks for sharing the comprehensive post, your post having informative&valuablecontent,it will be helpfull.|Advertising Agency in Hyderabad
ReplyDeleteGet the answer for the query “ How To Get a Job in Infosys as a Fresher? ” with the real-time examples and best interview questions and answers from the best software training institute in Chennai, Infycle Technologies. Get the best software training and placement with the free demo and great offers, by calling +91-7504633633, +91-7502633633.
ReplyDeletenice post and thanks for sharing with us.
ReplyDeletejava-full-stack-developer