Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance #74

Open
stefanpenner opened this issue Sep 16, 2015 · 12 comments
Open

performance #74

stefanpenner opened this issue Sep 16, 2015 · 12 comments

Comments

@stefanpenner
Copy link
Collaborator

There is an easy way to get much better performance. Currently, everything in bower_components/vendor and app are considered when determining if a rebuild is needed or not.

Now this means stuff "magically" works, but this means as an app and vendor grow. Copious time is spent merely figuring out if some input file changed or not.

We have several options, likely worth exploring. Most affective would be:

  1. only watch app/styles by default
  2. give users an API to add additional "input paths"

An example API could be:

var app = new EmberApp();

app.cssPaths.concat([
  app.name + '/styles/**/*.scss',
  'bower_components/material-design-lite-src/src/**/*.scss'
]);

Another thing, would be to add matcher, to only both detecting specific file types. This will require some fixes to our change detection, but again may yield a good win.

Unfortunately, I am unclear if such a matcher exists. Would it be possible for us to only watch files with the following extensions? .css .scss .sass ?


Some recent micro-optimizations that yield a nice boost: (reducing costs of stats + crawls by 2x), but ^ would be a substantial win in many cases.

part 1: adopted-ember-addons/broccoli-sass-source-maps#5
part 2: ember-cli/broccoli-caching-writer#58

@simonexmachina
Copy link
Collaborator

Hey Stef, I've added you to this repo as well.

@elwayman02
Copy link
Contributor

@stefanpenner only watching app/styles would make pod styles difficult to handle, would it not? We shouldn't make users manually enter every pod they use.

@simonexmachina
Copy link
Collaborator

Any progress on this issue @stefanpenner?

@dmfenton
Copy link
Contributor

dmfenton commented Oct 5, 2016

Do you have any agreement on what an API would look like? I'm keen to help implement this as this bottleneck is adding 30 seconds to my cold starts (when using npm linked modules) and 2-3 seconds to each rebuild.

@dmfenton
Copy link
Contributor

dmfenton commented Oct 6, 2016

I hacked together an addon that passes a tree containing only /app/styles to this addon. This effectively allows me to control exactly what goes into my sass pipeline. It sped up my cold builds by 1/3rd and rebuilds by 2/3rds.

https://github.com/dmfenton/ember-cli-prune-style-tree

@simonexmachina
Copy link
Collaborator

@dmfenton @stefanpenner would be the best person to ask about this. Stef any thoughts on this? Is there someone else that would be good to speak to about this?

dmfenton pushed a commit to dmfenton/ember-cli-sass that referenced this issue Oct 10, 2016
Putting this here for discussion as it can help with adopted-ember-addons#74.

This PR adds a new option `onlyIncluded` which allows the user to prune the style tree down to just app/styles and anything in the `includePaths` array. This helps performance because the broccoli-caching-writer no longer has to stat everything in the addon trees (via walk-sync).  The speedup is especially pronounced when using linked modules because those trees can get very large.
@tamzinblake
Copy link

Are there any updates on this one? ember-cli-prune-style-tree doesn't seem to be a drop-in solution for us.

@tamzinblake
Copy link

@stefanpenner Any news?

@ctusch
Copy link

ctusch commented Mar 1, 2018

Thanks to @dmfenton's addon our rebuild times were reduced by 2/3 (from about 7 seconds to about 2). This should be part of ember-cli-sass!

@simonexmachina
Copy link
Collaborator

simonexmachina commented Mar 1, 2018 via email

@ctusch
Copy link

ctusch commented Mar 1, 2018

It's the one he posted above:
https://github.com/dmfenton/ember-cli-prune-style-tree

I'm not sure if it works for every use case but we haven't had any problems with it.

@ctusch
Copy link

ctusch commented Nov 22, 2018

We just had problems with compiling in-repo-addon styles using the app's outputPaths option. After some debugging I remembered installing above mentioned ember-cli-prune-style-tree addon. It only allows styles in the app directory to be compiled. So beware. If other people should run into the same problem here is what the error message looks like:

File not found: \app\styles\themes\addon\app.scss
in any of the following include paths:
...\tmp\sass_compiler-input_base_path-PuGpRr2a.tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants