sassc-ruby icon indicating copy to clipboard operation
sassc-ruby copied to clipboard

Amalgamate sassc library

Open liamwhite opened this issue 6 years ago • 3 comments

Please consider using a amalgamation of the libsass source for this repository.

One of my main complaints about this library is that it is excessively slow to compile. This isn't helped by the fact that I end up rebuilding it in CI occasionally, even despite providing a gem cache.

$ time gem install sassc
Building native extensions. This could take a while...
Successfully installed sassc-2.0.1
Parsing documentation for sassc-2.0.1
Done installing documentation for sassc after 0 seconds
1 gem installed

real	1m6.135s
user	1m1.721s
sys	0m2.371s

In order to remedy this, I experimented with amalgamation of the libsass source files, and found that this provided a huge improvement in compile times.

$ time gem install sassc-2.0.1.custom.gem 
Building native extensions. This could take a while...
Successfully installed sassc-2.0.1.custom
Parsing documentation for sassc-2.0.1.custom
Done installing documentation for sassc after 1 seconds
1 gem installed

real	0m12.271s
user	0m11.410s
sys	0m0.457s

I created the amalgamation in that repository using this shell script, however other repositories generally have custom tools that do this for them.

liamwhite avatar Jun 22 '19 18:06 liamwhite

Strange but I haven't been able to get nearly as much speed up. Still good though, went from 60s to 30s when compiling single-core.

glebm avatar Aug 23 '19 12:08 glebm

@glebm might be related to single-core performance. My computer has an i7 4790K with a 4GHz base clock and 4.4GHz boost clock.

liamwhite avatar Aug 23 '19 13:08 liamwhite

I have the exact same CPU. One difference is that my amalgamation script puts everything into a cpp file (no header) but I don't imagine that would make much difference. Perhaps the compilation flags I used are different.

glebm avatar Aug 23 '19 14:08 glebm