Why is my ember-cli build time so slow on windows?

后端 未结 6 1932
清酒与你
清酒与你 2021-02-05 05:49

Ember-cli is building very slowly with ember server on windows.

Build successful - 13126ms.

Slowest Trees                  | Total
----------------         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 06:34

    There are two big culprits:

    1. Real time file system scanning or protection
      • Realtime-protection from Windows Defender (also know as Microsoft Security Essentials in win7)
      • Windows Search Indexing
      • Antivirus scanning
    2. Unused files in your bower_components folder

    Real time Scanning

    During a build numerous files are generate in the ./tmp folder of the ember project, both the indexer and the realtime-protection make additional reads of each file which adds a significant amount of additional file I/O operations.

    The fix is to:

    • exclude node.exe and/or the ./tmp folder from realtime-protection, and
    • exclude the folder from indexing.
    • Disable real-time antivirus scanning

    This should get your build time down to a couple seconds. Additional speed improvements for Windows are being investigated continuing to be investigated in relation to Broccoli's handling of the build process.

    Managing unused bower files

    Having lots of files in the bower_components is the biggest culprit.

    I wrote up a script, clean-ember-cli.js, that deletes everything but ember-cli dependancies, and anything imported in the Brocfile.js. I'm getting back to around 5 second build times.

    Update

    Reports are that running console as admin also helps.

提交回复
热议问题