Skip to content

xwiki-contrib/less-vs-sass-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LESS vs SASS Benchmark

In XWiki, we want to build Bootstrap with a CSS preprocessor during the runtime. The question is: what is the best preprocessor for us, runnable in a java environment?

LESS

I have found 3 versions to be used with java:

SASS

I am using JRuby to runs the SASS compiler, which is written in Ruby. I use the official SASS port of bootstrap.

I am also testing with and without the "cache" option, that do not re-compile files imported via "@import" when they haven't changed. Since in XWiki, it may often compute new files. (it seems that LESS does not cache anything).

Protocol

I have both the sources of Bootstrap 3.1.1 for Less and Sass. I build it 100 times with each preprocessor.

  • Official LESS version: I manually set the LESS JS file to 1.7.0-rhino (latest)
  • Asual LESS version: I manually set the LESS JS file to 1.7.0-rhino (latest)
  • SASS version: 3.3.6 (latest).
  • LESS4J version: 1.8.2 (latest).

Results

Using Java HotSpot(TM) 64-Bit Server VM 1.7 on Ubuntu 13.10, with intel core i7 2.40Ghz and 8 gb of RAM.

For the whole:

  • Official LESS: 142 seconds
  • Asual LESS: 433 seconds
  • SASS: 86 seconds
  • SASS without Cache: 161 seconds
  • LESS4J: 66 seconds

Mean:

  • Official LESS: 1,425 seconds
  • Asual LESS: 4,337 seconds
  • SASS: 0,860 seconds
  • SASS without Cache: 1,617 seconds
  • LESS4J: 0,667 seconds

Median:

  • Official LESS: 1,372 seconds
  • Asual LESS: 4,283 seconds
  • SASS: 0,732 seconds
  • SASS without Cache: 1,4345 seconds
  • LESS4J: 0.5335 seconds

Standard Deviation:

  • Official LESS: 0,272 seconds
  • Asual LESS: 0,403 seconds
  • SASS: 0,667 seconds
  • SASS without Cache: 0,885 seconds
  • LESS4J: 0.403 seconds

Diagram

Notes

I am not a LESS nor SASS expert. So this benchmark may be improved by your suggestions.

Alternatives

  • There is a java version of SASS developed by Vaadin: Vaadin. The last time I tried, it was not able to compile Bootstrap.
  • Same for LESS, but old: LessCss4J

Thanks

About

A benchmark of LESS using Rhino and SASS using JRuby, but with also Less4j

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published