Comments (12)
I see you've got sass-rails installed. That's probably conflicting.
See here: #6 (comment)
from sassc-rails.
@bolandrm no, I don't, check the diff
from sassc-rails.
Ah, ok. After you check out the other branch, did you bundle
and spring stop
?
from sassc-rails.
I don't use spring and yeah, I did bundle :)
from sassc-rails.
interesting... perhaps you need to run bundle exec rake assets:precompile
? not sure.
Failing that, can you run bundle open sassc-rails
and add some puts
statements to see if the SassC::Rails template is being used?
# lib/sassc/rails/template.rb
module Sprockets3
def call(input)
context = input[:environment].context_class.new(input)
puts "using sassc rails" # <-------------
or if using sprockets 2
# lib/sassc/rails/template.rb
module Sprockets2
# ..
def evaluate(context, locals, &block)
puts "using sassc rails" # <-------------
see if that prints anything out during assets precompile...
from sassc-rails.
Yeah, I tried that too y-day, and it's definitely using sassc-rails b/c compilation time is ~15-20% slower vs ruby sass.
oleh@varyform-mbp:~/projects/project (experiments/sassc)$ rm -rf tmp/cache/assets public/assets && time bundle exec rake assets:precompile 2>/dev/null
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
using sassc rails
real 0m49.870s
user 0m40.718s
sys 0m9.516s
oleh@varyform-mbp:~/projects/project (experiments/sassc)$ git checkout master
Switched to branch 'master'
oleh@varyform-mbp:~/projects/project (master)$ rm -rf tmp/cache/assets public/assets && time bundle exec rake assets:precompile 2>/dev/null
real 0m43.718s
user 0m38.205s
sys 0m5.963s
from sassc-rails.
I'm not sure what's going on then. Here are my results:
# With sassc-rails:
bundle exec rake assets:precompile 2> /dev/null 29.52s user 6.44s system 99% cpu 36.180 total
# with normal sass-rails:
bundle exec rake assets:precompile 2> /dev/null 33.41s user 6.51s system 97% cpu 40.826 total
assets:precompile is noisy though, because it's compiling a bunch of stuff that isn't css. Could you try the benchmark that i have in the readme? (in rails console)
from sassc-rails.
When I try one file it's 4.53s
with sassc vs 6.16
with ruby sass.
Not even close to 4x, but still an improvement :)
The reason complete suit takes longer may be related to cache.
I have 2 big CSS files in my app, both have ±15 imports, but some of those imports match.
So ruby sass probably reuses compiled files for 2nd import.
Here in 2nd pass I don't remove tmp/cache/assets
and the difference is visible.
oleh@imac:~/projects/project (master)$ rm -rf tmp/cache/assets public/assets && time bundle exec rake assets:precompile 2>/dev/null
real 0m44.866s
user 0m37.571s
sys 0m6.530s
oleh@imac:~/projects/project (master)$ rm -rf public/assets && time bundle exec rake assets:precompile 2>/dev/null
real 0m11.291s
user 0m9.291s
sys 0m1.805s
from sassc-rails.
Are you using sass import
statement, or sprockets require
?
I could be wrong, but I don't believe that ruby sass can cache imported files. Just because you could have set different variables before importing the file, which would affect the compilation of the file.
On the other hand, sprockets require
can be cached.
from sassc-rails.
Imports only.
And my last comparison was not correct, b/c I have a lot of JS files (which are cached by sprockets) and some standalone sass files (specified in config/initializers/assets.rb
)
When I only keep those 2 big files in assets.rb
and remove sprockets cache – there is no difference at all with ruby sass.
And the same flow on sassc
branch gives me 7s
vs 22s
.
Will probably try to do some more benchmarks to figure out what exactly makes whole suit to take more time in my case.
The issue can be closed, sorry for wasting your time :)
from sassc-rails.
No problem. Let me know if you find any interesting results. Thanks!
from sassc-rails.
The problem was in sprockets: master
branch was using 2.12.4, while sassc
3.3.5.
Updating sprockets on master to same 3.3.5 gave the following results:
- master before sprockets update: 41s
- master after sprockets update: 59s
- sassc: 49s
from sassc-rails.
Related Issues (20)
- incompatibilty with sprocket 4 HOT 2
- Migration plan now that LibSass is deprecated? HOT 1
- How to pre-compile library?
- Glob Imports Not Working (Workaround Found)
- SIL license used, but not mentioned in LICENSE file HOT 1
- SassC attempts to process each partial individually HOT 1
- unable to resolve type 'size_t' on Apple Silicon Macs HOT 2
- rb_safe_level will be removed in Ruby 3.0 HOT 2
- Sourcemaps aren't available in debug mode with Sprockets 4
- Broken README Link HOT 1
- symbol not found in flat namespace '__ZSt28__throw_bad_array_new_lengthv' HOT 1
- CI: Use a working service
- Cannot load file sass-rails HOT 1
- Upgrade sassc to avoid SIGABRT (code 134) in rake task HOT 4
- Problem with adding a png background HOT 1
- Dead link in README.md HOT 1
- Error in production mode on RoR 7.0.3.1 with Bootstrap 5.2 HOT 6
- freeze HOT 4
- image helpers borked v2.1.2 HOT 1
- Repeated Issue When I Run "rails server"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sassc-rails.