ember-cli: ember-cli is slow with > 100,000 files in bower_components


Slowest Trees                                 | Total               
----------------------------------------------+---------------------
SourcemapConcat                               | 2559ms              
SourcemapConcat                               | 2486ms              
SourcemapConcat                               | 2277ms              
SourcemapConcat                               | 2166ms              
SassCompiler                                  | 1953ms              
Funnel: App JS Files                          | 814ms               

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
SourcemapConcat (8)                           | 9517ms (1189 ms)    
SassCompiler (1)                              | 1953ms              
Funnel: App JS Files (1)                      | 814ms    

package.json:

 "devDependencies": {
    "broccoli-asset-rev": "^2.0.2",
    "ember-cli": "1.13.1",
    "ember-cli-app-version": "0.4.0",
    "ember-cli-babel": "^5.0.0",
    "ember-cli-content-security-policy": "0.4.0",
    "ember-cli-dependency-checker": "^1.0.0",
    "ember-cli-htmlbars": "0.7.9",
    "ember-cli-htmlbars-inline-precompile": "^0.1.1",
    "ember-cli-ic-ajax": "0.2.1",
    "ember-cli-inject-live-reload": "^1.3.0",
    "ember-cli-qunit": "0.3.15",
    "ember-cli-release": "0.2.3",
    "ember-cli-sass": "3.3.1",
    "ember-cli-uglify": "^1.0.1",
    "ember-data": "1.13.5",
    "ember-disable-proxy-controllers": "^1.0.0",
    "ember-document-title": "1.13.0",
    "ember-export-application-global": "^1.0.2"
  }

ember-cli-build.js:

/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    sourcemaps: {
      enabled: false,
      sourceMap: false
    }
  });

  //import material design lite
  app.import('bower_components/material-design-lite-src/dist/material.js');
  app.import('bower_components/material-design-icons/iconfont/MaterialIcons-Regular.woff2',{
    destDir: 'assets/fonts'
  });
  app.import('bower_components/material-design-icons/iconfont/MaterialIcons-Regular.woff',{
    destDir: 'assets/fonts'
  });
  app.import('bower_components/material-design-icons/iconfont/MaterialIcons-Regular.ttf',{
    destDir: 'assets/fonts'
  });
  app.import('bower_components/material-design-icons/iconfont/MaterialIcons-Regular.eot',{
    destDir: 'assets/fonts'
  });

  return app.toTree();
};

and, my hrad disk is SSD.

help me,please. thanks very much.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 48 (25 by maintainers)

Most upvoted comments

updated #'s with https://github.com/ember-cli/ember-cli/pull/4621

initial build:

Build successful - 3078ms. (was nearly 20,000ms)

Slowest Trees                                 | Total
----------------------------------------------+---------------------
SassCompiler                                  | 2060ms

Slowest Trees (cumulative)                    | Total (avg)
----------------------------------------------+---------------------
SassCompiler (1)                              | 2060ms
Babel (3)     

incremental build:

Build successful - 1805ms. (was ~12,000ms)
Slowest Trees                                 | Total
----------------------------------------------+---------------------
SassCompiler                                  | 1457ms

Slowest Trees (cumulative)                    | Total (avg)
----------------------------------------------+---------------------
SassCompiler (1)                              | 1457ms

this still isn’t acceptable, I believe the SassCompiler times can be brought down to cost of “noise”

Interesting Summary:

  • 10s shaved off from both initial and incremental (on SSD, likely more on HDD)

  • remaining largest chunk of time appears to be easy pickings
  • will be part of the next CLI release

A quick look at SassCompiler reveals another relatively straight-forward set of fixes. I may limit external imports to ones explicitly added to the load-path. Although the ergonomics of that aren’t the best, the perf outcome is fantastic. A local prototype reveals with that change the SassCompiler times drop to ~200ms on initial, and nearly nothing on incremental (if no sass changed).

I hope to work on the sass story later this weekend.

relevant pr:

@stefanpenner You rock brother. Thanks for all you do.