gitlabhq/gitlabhq — Issue #218: Dashboard Loads Slowly With Many Projects
Author: mutewinter
Created: 2011-12-19 21:15:51+00:00
State: open

The reason the load is slow is because of the following code

```ruby
class DashboardController < ApplicationController
...

def index
@projects = current_user.projects.all
@active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
...
```

With 185 projects in the database, this operation takes about 5 - 10 seconds to load. Caching the last_activity_date in the projects model would be one fix for this.