开发者

Rendering views takes too long

开发者 https://www.devze.com 2023-04-05 07:46 出处:网络
I looked as similar questions, but there doesn\'t seem to be a related solution. I\'m currently using a new MBP(transitioned from a PC), so I\'m assuming its not a hardware issue since all I`m rende

I looked as similar questions, but there doesn't seem to be a related solution.

I'm currently using a new MBP(transitioned from a PC), so I'm assuming its not a hardware issue since all I`m rendering is static pages.

With the exact same configuration running on a PC everything seeme开发者_如何学JAVAd fine:

RVM 1.8.1

Ruby 1.8.7

Rails 3.0.3

Webrick 1.3.1

Cacheing doesn't really solve the problem since I'm working on design, thus need constant reloads.

Started GET "/" for 127.0.0.1 at Thu Sep 15 02:06:50 -0400 2011
  Processing by PagesController#home as */*
Rendered pages/home.html.erb within layouts/application (7.5ms)
Completed 200 OK in 24114ms (Views: 24113.6ms | ActiveRecord: 0.0ms)

This happens quite often, sometimes the severs shows lower rendering times but it doesn't refresh the page in the browser for another 10x seconds.

Any help would be deeply appreciated.


I'm not sure if this would explain differences between running on windows and mac (i'd imagine they'd be the same), but could it be the fact that your environment is being reloaded for each request in development mode?

On larger code bases, I've had this problem with slow loading and rails_development_boost works wonders. It basically caches your classes, but monitors the FS for changes to files and reloads them at runtime (you don't have to stop/start server constantly).

In your Gemfile

group :development do 
  gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'
end

If that doesn't help, can you post some examples of any iteration that may be taking place in the pages/home.html.erb file that could explain the slow down?

0

精彩评论

暂无评论...
验证码 换一张
取 消