Topic: SLOW Rendering of Views

Hi,

I've been experiencing some severe slowness in rendering the views in my users/index action. It's really not doing anything fancy at all, and has been driving me nuts the last few days. I'm running Rails 2.2... does anyone have any idea how to resolve this:

Rendering users/index
Completed in 11386ms (View: 8693, DB: 151)

Rendering users/index
Completed in 5024ms (View: 3286, DB: 16)

Rendering users/index
Completed in 11692ms (View: 8811, DB: 105

Rendering users/index
Completed in 11184ms (View: 8116, DB: 364)

Rendering sessions/new
Completed in 1696ms (View: 1012, DB: 0)

Rendering users/index
Completed in 8361ms (View: 6898, DB: 107)

#_user.html.erb
<div>
        <h2>Users</h2>
         <%= render :partial => "users/user", :collection => @users %>
        <%= will_paginate @users %>
        <% if @users.empty? -%>
                <p class="infobox">Looks like we couldn't find anything matching your search. Maybe you should consider broadening it?</p>
        <% end -%>
</div>


Look at home much time is being consumed by the view. Obviously those response times are unacceptable, and this is with 3 instances of Thin running in production on a VPS...

The template code is here too: http://gist.github.com/90786

Any ideas?

Thanks!

Avishai

Re: SLOW Rendering of Views

A strange thing just happened. I just upgraded production to Rails 2.3.2, and the performance stats have reversed:

Processing UsersController#index [GET]
  Parameters: {"action"=>"index", "controller"=>"users", "page"=>"5"}
Rendering template within layouts/application

Rendering users/index
Completed in 1361ms (View: 414, DB: 964)

Processing UsersController#index (for 131.107.0.70 at 2009-04-06 15:37:12)
Rendering users/index
Completed in 2503ms (View: 612, DB: 1887)

Rendering users/index
Completed in 2395ms (View: 153, DB: 2238)

I am so confused!