lingui.st Translating software made easy

How Rails 3.1 will speed up your application with Automatic Flushing

Posted on September 8, 2010

Just a few weeks back, Rails 3 was released after 2 years. One would expect that the Rails developers would take some time off before tackling Rails 3.1. No, not the always busy Rails developers. As DHH hinted in his keynote speech, Rails 3.1 will come with some great performance improvements. No, he wasn’t talking about the framework itself nor Ruby (simply because both aren’t the bottlenecks anymore), he was talking about perceived client performance. Yehuda Katz just wrote a blog post about a new feature in Rails 3.1 called “Automatic Flushing”. Flushing is a technique that basically streams an HTTP response. So instead of waiting the whole page to load JavaScript, CSS, Images, …, the browser gets parts of the page and can start loading right away.

Here a graph showing an HTTP response without flushing:

HTTP Response without flushing

And here a graph showing an HTTP response with flushing:

HTTP Response with flushing

It is pretty obvious that flushing can make a huge difference (depending on the site) on perceived performance. The good news, in Rails 3.1 you will get this behavior for free. Yes, without doing anything your application will get faster. Another reason why Rails is just THE best web framework.

Sources:

Automatic Flushing by Yehuda Katz

Images from template_streaming

Lingui.st - Online Resource Editor, Manage your Ruby/Rails, Java, .Net and C++ language files with ease

Related posts:

  1. Speed up your WordPress Site with the best performance plugin
  2. Speed up your website with CDN and Rails
  3. Presentation from Yehuda Katz: The Great Rails Refactor

Tags: , , , , , , ,

  • http://blog.dynatrace.com Andreas Grabner

    Great example on how progressive rendering / early flushing can speed up web site performance.