- device: MacBook Air 2017
- node version: 12
- yarn version: 1.17.3
- npm version: 6.3.0
- test datetime: 7 Aug 2019 00:30 A.M. Bangkok time
Internet speed https://speedtest.trueinternet.co.th)
Sample package.json
{
"name": "demo-app-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"node-sass": "^4.12.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.1",
"react-scripts": "3.0.1"
}
}
Test yarn performance scenario
- remove node_modules
- remove yarn.lock
- measure yarn speed by running => start=$(date +'%s') && yarn && echo "It took $(($(date +'%s') - $start)) seconds"
Test npm performance scenario
- remove node_modules
- remove package-lock.json
- measure yarn speed by running => start=$(date +'%s') && npm i && echo "It took $(($(date +'%s') - $start)) seconds"
Result
Package manager / Speed (seconds) | Round 1 | Round 2 | Round 3 |
---|---|---|---|
npm | 104 | 72 | 72 |
yarn | 200 | 171 | 157 |
ไม่มีความคิดเห็น:
แสดงความคิดเห็น