title: Grails vs Spring performance for REST
body: <p>I've created some REST endpoints using pure Groovy/Grails. For now most of the operations are all CRUD-like.</p>
  
  <p>I'm beginning to compare the performance of the Grails app to an equivalent Java/Spring app for the CRUD scenarios that I've made, using JMeter. So now I'm taking a subset of the scenarios I've implemented in Grails and porting to a basic Spring MVC app.</p>
  
  <p><strong>I'm very interested in seeing performance comparisons published by others on the web.</strong> Can anyone refer me to some?</p>
  
  <p>Any other information in regards to the testing and analysis I'm going to do is welcome. Thanks!</p>
  
  <hr>
  
  <p><strong>UPDATE REGARDING THE ANSWER</strong>:</p>
  
  <ul>
  <li>@Lari's answer below references a website with extremely comprehensive tests, comparing <a href="https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Groovy/grails" rel="nofollow">Grails 2.X</a> vs <a href="https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Java/spring" rel="nofollow">Spring 4.X</a> (see README.md), in addition to a multitude of other frameworks.
  
  <ul>
  <li>However, those tests have <strong>Grails running on Resin</strong> while <strong>Spring is on Tomcat</strong>. A little strange to me since Grails uses Tomcat by default.</li>
  <li>Resin and Tomcat arguably have <a href="http://www.webperformance.com/library/reports/ServletReport/" rel="nofollow">similar performance</a>.</li>
  </ul></li>
  <li>The website has several sections (tabs on top) and even subsections (tabs in the "Results" area). My original question was regarding web service behavior for REST. To that end here are the top-level sections that answered my question:
  
  <ul>
  <li><a href="http://www.techempower.com/benchmarks/#section=data-r11&amp;hw=peak&amp;test=query" rel="nofollow">Querying multiple rows in a DB table</a> (HTTP GET) and returning JSON array as result.</li>
  <li><a href="http://www.techempower.com/benchmarks/#section=data-r11&amp;hw=peak&amp;test=update" rel="nofollow">Modifying multiple rows in a DB table</a> and returning JSON array as result. This test does not use HTTP PUT with a body, but instead HTTP GET. Scroll to bottom of page for details, and also <a href="http://www.techempower.com/benchmarks/#section=code" rel="nofollow">Requirements</a> page.</li>
  </ul></li>
  <li>If you're interested in HTML rendering see the <a href="http://www.techempower.com/benchmarks/#section=data-r11&amp;hw=peak&amp;test=fortune" rel="nofollow">Fortune Cookie</a> example.</li>
  </ul>
  
  <p>Not surprisingly Spring is better, but like @Joshua points out, this is a contrived example and you will have to be the judge of what to extrapolate from the results. Not to mention that Grails used Resin while Spring used Tomcat. Hopefully each server (Tomcat / Resin) was configured similarly in terms of max threads, Java memory, etc? The config files may be buried in the <a href="https://github.com/TechEmpower/FrameworkBenchmarks" rel="nofollow">source code</a> (if you find out, let me know).</p>
  
  <p>I also setup dummy applications for Spring 4.X vs Grails 2.X, with Tomcat being configured exactly the same (both used the same standalone Tomcat installation rather than one bundled inside Grails). In my tests I performed an HTTP GET and returned a JSON array which was formed using static (pre-instantiated) in-memory objects (no DB query). My results also showed better performance for Spring (sorry I can't find my data any longer!). I used Spring Boot to slap a Spring app together quickly, and Grails already has scaffolding by default.</p>