I have a Symfony2 application running in dev mode inside a Ubuntu VirtualBox on a MacBook Pro. The site is running quite fast until i want to dump and/or watch (app/console assetic:dump) the assets. It takes around 20-30 seconds to dump 42 scss- and some js files. The watcher is slow as well, after changing one file, it takes 10-15 seconds till the changes are done. Is this normal? On my local machine, it takes just 5 seconds to compile the files with compass.
Any ideas, how i could speed up the whole process?
ruby: 1.8.7
compass: 1.0.1
sass: 3.4.6
That's how the dev
environment works. You are working with assets and code that change on the fly as you develop and therefore Symfony clears its compiled cache between every page load to render the most recent results for you.
Assetic also breaks the files down into its individual CSS files instead of aggregating them for you into one file so you can debug your SCSS files in the browser inspector. Since you're using 42 SCSS files to compile with SASS on the fly, it's not surprising that assetic:dump
takes a while.
The watcher is the same scenario since all it does it do the exact same thing above if it detects a change in any single file. It's simply a tradeoff of being able to design and develop on the fly with your dev environment.
Why is it slower than a vanilla compass
installation? To speculate, there's more steps involved in how Assetic manages your files - it must locate them from your templates, rewrite paths (if cssrewrite
is enabled), move the files around, and then compile.
Your options are:
but once you deploy this to the prod
environment, you will have everything cached for much longer periods of time, and therefore you won't run into the 20-30 second problems with assetic compiling on the fly.