Practical comparison of Rails 2.0.2 with Rails 1.2.6

After testing at home and resolving various warnings, I finally upgraded Rankforest to Rails 2.0.2. Rankforest allows authors and publishers to keep track of the sales rank of their books. The site has about 2,000 users, and many keep up to date with rankings through RSS feeds or by exporting rankings every couple of days.

I was interested to see how the latest version of Rails would perform, especially after reading the posts mentioned here.

I allowed the site to run for a good full week before running rawk on them. I already had many megabytes of logs from the site running on Rails 1.2.6.

Here's a slim rundown, focusing on the average time required to complete a request.

The detail view - This view is the dashboard for a given item. It contains a product image, a chart showing sales ranks, and some running averages. Each log contained 1500-3000 sample requests. Before: 0.45s After: 0.42s

Hourly RSS feed - The hourly RSS feed gives authors a sales rank update every hour. I also had a couple thousand requests for this page in each log. Before: 0.07s After: 0.04s

Daily RSS feed - The daily RSS feed has a sales rank for the past 10 days.
Before: 0.40s After: 0.30s

Cached charts - This is how long it takes to render a cached sales rank chart. Before: 0.71s After: 0.50s

Items listing - This view shows all of the items Rankforest is tracking and allows the user to paginate through them. I only had a few hundred requests for this. I think the difference must be due to updating the plugin I use for pagination. Prior to seeing these results I debated moving to will_paginate, but this is fine for now.
Before: 1.40s After: 0.18s

Item compare - This is a view that allows a user to compare their book to similar items on Amazon.com. I had a couple hundred requests in each log. Before: 0.11s After: 0.15s

The collection view - Logged in users can view all of their books and sort them using various criteria.
Before: 0.05s After: 0.09s

The last two areas of the site showed tiny slowdowns for some reason, but the gains in the more heavily-trafficked portions of the site outweigh the decrease.

The top line of the rawk script output shows the average for all requests. Here's how that worked out (86K requests under Rails 2.0.2 and 58K under 1.2.6). Before: 0.17s After: 0.07s

In terms of requests/second, that's going from 352req/sec to 857req/sec, which sounds substantial. In addition to updating the pagination plugin, I think a lot of the performance gain stems from the move from SqlSessionStore to the new cookie-based sessions.

The migration was mostly painless. I didn't have to change much code, the VPS hasn't changed, and now Rankforest can serve up even more information than before.