2

We're using Rake::Pipeline::Middleware to serve a rake-pipeline project with Rack. It seems incredibly slow, like it's rebuilding everything whenever a file has changed.

Are we doing something wrong? Is there something we can do to speed it up?

Charles
  • 50,943
  • 13
  • 104
  • 142
Jo Liss
  • 30,333
  • 19
  • 121
  • 170

2 Answers2

1

If you are compressing the files you should put a conditional in your Assetfile to not compress in development. The concat filters are not that slow. The uglify and yui_css filters are and you don't need the compression for dev.

bcardarella
  • 4,667
  • 4
  • 29
  • 45
  • Thanks! We're not uglifying in development actually. Plenty of Sass and CoffeeScript though. – Jo Liss Jan 05 '13 at 00:46
  • ah, yeah that will be slow as well. I assume you're using Guard? Your Guardfile might be too aggressive in how it rebuilds (everything?) – bcardarella Jan 05 '13 at 00:50
  • There's a Guardfile, but when you run `rackup` with the `Rake::Pipeline::Middleware`, guard shouldn't be used at all, should it? There's no reference to any guarding in `config.ru` or `Assetfile`. – Jo Liss Jan 05 '13 at 00:51
1

Adding therubyracer gem has helped as well, cutting total compile time by factor 3. We are compiling a lot of CoffeeScript, and having therubyracer available avoids shelling out to Node.

Jo Liss
  • 30,333
  • 19
  • 121
  • 170
  • Great tips! Did you do anything in addition to requiring the gem on top of the Assetfile? – sandstrom May 23 '13 at 15:56
  • 1
    I think it will actually require it [automatically](https://github.com/sstephenson/execjs/blob/1e87b3735176c6e656e4b5ba18ed10214b321ba5/lib/execjs/ruby_racer_runtime.rb#L98), so all you have to do is add therubyracer to your Gemfile. – Jo Liss May 23 '13 at 22:32