How to benchmark npm/yarn install process?

Home / Uncategorized / How to benchmark npm/yarn install process?

Question:
I am working on a reactjs+mobx frontend project and using es6, babel, and webpack. I am using yarn install to download the dependencies and does the babel transpile work. In my project, yarn install takes more than 20 minutes to complete. I can say that the download only takes 1 or 2 mintues so most of them time is spent on babel or something else. Is there a way for me to figure out which part takes such a long time? My hardware is Mac Pro with 16GB memory. I don’t have any performance on other open source reactjs project. It seems that only happen on my project so I am looking for a way to find the root course.

Below is my project dependencies.
"devDependencies": {
"@blueprintjs/core": "^1.17.1",
"@blueprintjs/table": "^1.14.0",
"autobind-decorator": "^1.3.4",
"babel-cli": "^6.24.1",
"babel-core": "^ 6.24.1",
"babel-eslint": "^7.2.2",
"babel-jest": "^19.0.0",
"babel-eslint": "^7.2.2",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-root-import": "^5.1.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"chai": "^3.5.0",
"chai-enzyme": "^0.6.1",
"cldr-data": "^31.0.2",
"codemirror": "^5.27.2",
"codemirror-colorpicker": "^1.0.8",
"codemirror-formatting": "^1.0.0",
"codemirror-highlight": "^1.0.0",
"cross-env": "^3.1.4",
"css-loader": "^0.28.4",
"d3": "^4.10.0",
"dumpenvy": "^1.1.0",
"d3": "^4.10.0",
"dumpenvy": "^1.1.0",
"enzyme": "^2.7.1",
"enzyme-to-json": "^1.5.1",
"esdoc": "^0.5.2",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-import-resolver-node": "^0.3.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^6.10.0",
"eventemitter2": "^4.0.0",
"extract-text-webpack-plugin": "^2.1.0",
"feathers-client": "^1.9.0",
"feathers-primus": "^2.0.0",
"file-loader": "^0.11.2",
"filesize": "^3.5.10",
"globalize": "^1.2.3",
"globalize-webpack-plugin": "^1.0.0",
"handlebars": "^4.0.10",
"handlebars-loader": "^1.5.0",
"html-webpack-plugin": "^2.28.0",
"http-server": "^0.10.0",
"html-webpack-plugin": "^2.28.0",
"http-server": "^0.10.0",
"ignore-styles": "^5.0.1",
"image-webpack-loader": "^3.3.1",
"imports-loader": "^0.7.1",
"jest": "^20.0.4",
"lazy-route": "^1.0.7",
"little-loader": "^0.2.0",
"lodash": "^4.17.4",
"mobx": "^3.1.9",
"mobx-react": "^4.1.8",
"mobx-react-devtools": "^4.2.11",
"mobx-react-form": "^1.20.5",
"moment": "^2.17.1",
"mousetrap": "^1.6.1",
"mousetrap-global-bind": "^1.1.0",
"node-fetch": "^1.7.1",
"node-sass": "^4.5.3",
"package": "^1.0.1",
"postcss-loader": "^2.0.5",
"precss": "^1.4.0",
"prettier-standalone": "^1.3.1-0",
"react": "~15.4.2",
"prettier-standalone": "^1.3.1-0",
"react": "~15.4.2",
"react-addons-css-transition-group": "^15.0.1",
"react-addons-test-utils": "^15.4.2",
"react-codemirror": "github:SouthbankSoftware/react-codemirror",
"react-dnd": "^2.2.4",
"react-dnd-html5-backend": "^2.2.4",
"react-dom": "~15.4.2",
"react-ga": "^2.2.0",
"react-hot-loader": "next",
"react-json-tree": "^0.10.7",
"react-router-dom": "^4.0.0-beta.6",
"react-select": "^1.0.0-rc.4",
"react-shortcut": "^1.0.6",
"react-split-pane": "^0.1.64",
"react-svg-loader": "^1.1.1",
"react-test-renderer": "^15.4.2",
"recharts": "^0.22.4",
"resolve-url-loader": "^2.0.0",
"rimraf": "^2.5.4",
"sass-loader": "^6.0.5",
"shebang-loader": "0.0.1",
"shelljs": "^0.7.7",
"shebang-loader": "0.0.1",
"shelljs": "^0.7.7",
"style-loader": "^0.18.2",
"test-utils": "^1.0.18",
"url-loader": "^0.5.7",
"uuid": "^3.0.1",
"validatorjs": "^3.11.0",
"webpack": "^2.6.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-dev-server": "^2.4.5",
"webpack-merge": "^4.1.0",
"xml2js": "^0.4.17"
},
"dependencies": {
"mongodb-uri": "^0.9.7",
"react-json-view": "^1.10.12",
"worker-loader": "^0.8.1"
}
Below is the node version I am using:$ node –version
v7.9.0
$ yarn –version
0.24.5
Below is the output of yarn install:yarn run v0.24.5
$ webpack –config webpack/prod.js –optimize-minimize
(node:7041) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Hash: 3fc20db1441aa4cbeb7c
Version: webpack 2.7.0
Time: 1770119ms


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *