Hello, i''m working on huge rails project and it''s terribly slow in development mode. There are lots of code and lots of AJAX requests, so it''s very slow as (i guess) it reloads all the code several times per one page. I''m wondering, maybe there is a way to speed it up? Maybe it''s possible to reload it for example every 15 seconds? Or even better - every 15 seconds check for changed files and reload only if there is changes. What do you think? -- Posted via http://www.ruby-forum.com/.
Silly question: Are you using Webrick or Mongrel? When I prepped up a little rails dev app in Webrick, it was so slow I wanted to chuck it. Then I put in Mongrel and it speed things up by literally a 100+ percent. On Wed, Jul 22, 2009 at 10:41 AM, Alexey Petrushin<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hello, i''m working on huge rails project and it''s terribly slow in > development mode. > > There are lots of code and lots of AJAX requests, so it''s very slow as > (i guess) it reloads all the code several times per one page. > > I''m wondering, maybe there is a way to speed it up? Maybe it''s possible > to reload it for example every 15 seconds? Or even better - every 15 > seconds check for changed files and reload only if there is changes. > > What do you think? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Rilindo Foster AOL Instant Messenger: rilindo Google Talk: rilindo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Web Site: http://www.monzell.com Primary: rilindo-BUHhN+a2lJ4@public.gmane.org Secondary: rilindo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org "Rich bachelors should be heavily taxed. It is not fair that some men should be happier than others. -- Oscar Wilde
i think Foster is right. webrick is bit slower. if you use Mongrel then its become more faster. you can make mongrel cluster to make it more faster. in spite of making the cluster if you think your app is still slow then you can use performance analysis tool like new relic. it will help you to see which part of your coding is taking the most of the time. in my case i have found that eager loading makes the code bit faster as it always reduce the query moreover you can cache the static content of you site even you can partially cache the content of page. these small things will help you to make your site faster On Jul 22, 9:05 pm, rilindo foster <rili...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Silly question: Are you using Webrick or Mongrel? > > When I prepped up a little rails dev app in Webrick, it was so slow I > wanted to chuck it. Then I put in Mongrel and it speed things up by > literally a 100+ percent. > > On Wed, Jul 22, 2009 at 10:41 AM, Alexey > > > > Petrushin<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > Hello, i''m working on huge rails project and it''s terribly slow in > >developmentmode. > > > There are lots ofcodeand lots of AJAX requests, so it''s very slow as > > (i guess) it reloads all thecodeseveral times per one page. > > > I''m wondering, maybe there is a way to speed it up? Maybe it''s possible > > to reload it for example every 15 seconds? Or even better - every 15 > > seconds check for changed files and reload only if there is changes. > > > What do you think? > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > Rilindo Foster > AOL Instant Messenger: rilindo > Google Talk: rili...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > Web Site:http://www.monzell.com > Primary: rili...-BUHhN+a2lJ4@public.gmane.org > Secondary: rili...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > "Rich bachelors should be heavily taxed. It is not fair that some men > should be happier than others. -- Oscar Wilde
> Silly question: Are you using Webrick or Mongrel?No, I''m using Mongrel.> these small things will help you to make your site fasterI''m talking about the development environment, in the production (in cluster) it works fast :). The problem is here (config/development.rb):> config.cache_classes = falseif i change it to>config.cache_classes = trueit works really fast. So i hoped maybe there is a way to reload it more rarely. -- Posted via http://www.ruby-forum.com/.
Okay, now that makes sense. :) Now that said, my understanding is that turning cache off in development is a bad thing, because that meant that new code will not be executed automatically until you restart the server. I could be wrong, though. . . On Wed, Jul 22, 2009 at 3:38 PM, Alexey Petrushin<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> >> Silly question: Are you using Webrick or Mongrel? > No, I''m using Mongrel. > >> these small things will help you to make your site faster > I''m talking about the development environment, in the production (in > cluster) it works fast :). > > The problem is here (config/development.rb): >> config.cache_classes = false > if i change it to >>config.cache_classes = true > it works really fast. > > So i hoped maybe there is a way to reload it more rarely. > -- > Posted via http://www.ruby-forum.com/. > > > >-- Rilindo Foster AOL Instant Messenger: rilindo Google Talk: rilindo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Web Site: http://www.monzell.com Primary: rilindo-BUHhN+a2lJ4@public.gmane.org Secondary: rilindo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org "Rich bachelors should be heavily taxed. It is not fair that some men should be happier than others. -- Oscar Wilde
On Jul 22, 8:38 pm, Alexey Petrushin <rails-mailing-l...@andreas- s.net> wrote:> > The problem is here (config/development.rb):> config.cache_classes = false > if i change it to > >config.cache_classes = true > > it works really fast. > > So i hoped maybe there is a way to reload it more rarely.There''s nothing builtin - doesn''t mean there''s not a way for you to change it though! I''d start by looking at how the existing code reloading stuff works. Fred