I have an angular project project with yoman talking to the rails api backend.
Everything works fine except that grunt tasks are very slow.
When I started grunt server --verbose :
Execution Time (2014-01-15 13:37:55 UTC) loading tasks 14.3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 26% server 1ms 0% preprocess:multifile 11ms 0% clean:server 13ms 0% concurrent:server 34.3s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 63% autoprefixer 1ms 0% autoprefixer:dist 369ms ▇ 1% connect:livereload 17ms 0% watch 5.8s ▇▇▇▇▇▇▇▇▇ 11% Total 54.8s
Some of my grunt file:
'use strict'; module.exports = function (grunt) { require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); require('time-grunt')(grunt); grunt.initConfig({ ... }); grunt.loadNpmTasks('grunt-preprocess'); grunt.registerTask('server', function (target) { if (target === 'dist') { return grunt.task.run(['build', 'connect:dist:keepalive']); } grunt.task.run([ 'preprocess:multifile', 'clean:server', 'concurrent:server', 'autoprefixer', 'connect:livereload', 'watch' ]); }); grunt.registerTask('test', [ 'clean:server', 'concurrent:test', 'autoprefixer', 'connect:test' //'karma' ]); grunt.registerTask('build', [ 'preprocess:multifile', 'clean:dist', 'useminPrepare', 'concurrent:dist', 'autoprefixer', 'concat', 'copy:dist', 'cdnify', 'ngmin', 'cssmin', 'uglify', 'rev', 'usemin' ]); grunt.registerTask('default', [ 'jshint', 'test', 'build' ]); };
Project Size:
vagrant@vm ~code/myapp/app/scripts $> find -name "*.js" | xargs cat | wc -l 10209
I work on MacOS 10.8 with an i7 processor, 16 GB of RAM, SSD ... Is this normal, what took so long? What makes the grunt task (and especially the "boot task") so slow?
Note. . I am in a car with a tramp and running grunt commands. If I run the grunt command on my native system, it is much faster ( loading tasks takes 1.6s instead of 14.3).
Thus, a shared file system can be a problem. But why...