We have a lot of less, it compiles to 300 + 400 kb css files.
Compilation takes 20-25 seconds.

I switched from lessphp to less.js (and fixed issue with relative urls) and profiled compilation.

I found that compilation actually takes only 8-10 seconds and then 10-15 seconds spends for build dependencies for watch source files changes.
Dependencies rebuilds at every less compilation, but files don't adds or removes frequently.

I think that rebuild dependencies only after cache clear will be enough. It speeds up less rebuild at 50-70%.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

popstas created an issue. See original summary.

popstas’s picture

Status: Active » Needs review
FileSize
1.54 KB

After this patch cache 'less:devel:file_hash' don't rebuild after each less compilation.
If any of dependencies will modified, it timestamp will be updated in cache.
If developer want to add or remove file to less tree, he should clear cache for rebuild dependencies cache.
It don't affect to lessphp compiler because in it compilation and build dependencies list is single operation.
Tested with 7.x-4.0

Status: Needs review » Needs work

The last submitted patch, 2: less-dependencies_cache-2851608-2.patch, failed testing.

popstas’s picture

Status: Needs work » Needs review