Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCSS compilation is very slow with jruby #90

Closed
larryzhao opened this issue Mar 15, 2012 · 7 comments
Closed

SCSS compilation is very slow with jruby #90

larryzhao opened this issue Mar 15, 2012 · 7 comments

Comments

@larryzhao
Copy link

I use jruby-1.6.7 with rails3.2, under jruby, scss compilation gets very slow..it takes like 10 seconds to refresh a page if I've done some changes to any scss files, following is the compilation time from development.log:

with jruby:

Started GET "/playground/dashboard" for 0:0:0:0:0:0:0:1%0 at 2012-02-29 12:30:18 +0800
Processing by PlaygroundController#index as HTML
  Parameters: {"partial"=>"dashboard"}
  Rendered playground/_dashboard.erb (1.0ms)
  Rendered playground/show.html.erb within layouts/application (2.0ms)
Compiled application.css  (11540ms)  (pid 5518)
Completed 200 OK in 11660ms (Views: 11660.0ms)

with MRI:

Started GET "/playground/dashboard" for 127.0.0.1 at 2012-02-29 12:32:53 +0800
Processing by PlaygroundController#index as HTML
  Parameters: {"partial"=>"dashboard"}
  Rendered playground/_dashboard.erb (0.0ms)
  Rendered playground/show.html.erb within layouts/application (0.5ms)
Compiled application.css  (1283ms)  (pid 5674)
Completed 200 OK in 1323ms (Views: 1323.1ms)

I had a talk with a guy from jruby irc channel, he said he also has tons of scss in his rails project and the performance is pretty well, and I also tested with a fresh rails project, and it's also pretty good.

@chrisnicola
Copy link

There is a problem that has been happening with sass versions of bootstrap that use compass, but it seems to be a compass/sass + rails pipeline issue and there currently doesn't appear to be any good solutions outside of not using the asset pipeline for sass.

Keeping your sass very simple seems to help as well.

Compass/compass-rails#26
rails/rails#5497

@larryzhao
Copy link
Author

Thanks lucisferre. I am not using compass for my project, does this gem wrap a compass to do the convertion? And it's also hard to make the sass simple...err...once I @import bootstrap it starts to become very slow...

@chrisnicola
Copy link

It isn't anything to do with compass specifically. It's just the sass version of bootstrap. Though people have reported problems with any reasonably complex sass structure with a decent number of files.

@chrisnicola
Copy link

The fix to sass/sass#337 actually fixes this completely for me. Just found it.

You'll need to use the master branch in your Gemfile.

  gem 'sass', git: 'git://github.com/nex3/sass.git'

@larryzhao
Copy link
Author

Thanks @LucisFerre, I just tested it. It's now ~2.5 sec. Although it's not as good as mri, but still a big improvment.

@thomas-mcdonald
Copy link
Member

This should be fixed with a combination of sass/master (will be in the 3.2 release) and 37563aa. Cheers!

@larryzhao
Copy link
Author

Thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants