weixin_39933724 2020-11-30 14:20
浏览 0

Performance enhancement

From on September 26, 2015 14:28

Currently, depCheck looks for all files under directory to get dependency result.

Some strategies can be used to optimize the performance: 1. First, it get packages from a part of files, compare with declaring packages. 2. If all declaring packages are used, stop reading files. Return everything is good. :white_check_mark: 3. If not all declaring packages are used, continue the step 1. 4. If all files are searched, but there are some declaring packaged not fulfilled, show them as unused. :x:

Concretely, it need to convert the promise queue in checkDirectory to Array<Func<Promise>> queue. The promises are triggered only then function is invoked.

Copied from original issue: lijunle/depcheck-es6#49

该提问来源于开源项目:depcheck/depcheck

  • 写回答

9条回答 默认 最新

  • weixin_39933724 2020-11-30 14:20
    关注

    Use benchmarkjs to compare the performances of different strategies.

    评论

报告相同问题?