You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When changing branches, the developer is penalized with a >100s worth of Lerna bootstrap and installation processes to have their deps working properly.
Analysis
Today's recommended one-command-to-solve-it-all command is to just run npm i on the root directory. Although convenient, the first step is rarely needed, and takes significant time (18%)
root npm i: installs/updates dependencies on the root package (basically just lerna)
which calls npm run bootstrap, installing packages dependencies and linking them locally
npm i from root does not need to be run every time
The root npm i usually deletes the contents of the root node_modules, because the hoisted dependencies are not present on the root package.json, while the bootstrap command installs them over again. Nonsense, right?
If we just take the shortcut, starting directly from npm run bootstrap, we cut the 22s from the root npm i itself, and as the node_modules directory is already populated, we cut another ~30s from the bootstrap itself.
❇️ advice: whenever changing branches, prefer using npm run bootstrap over npm i
before
after
root npm i
22s
0s
lerna bootstrap
55s
25s
build
43s
43s
Update documentation to highlight bootstrap as the main command to use on a daily basis.
When changing branches, the developer is penalized with a >100s worth of Lerna bootstrap and installation processes to have their deps working properly.
Analysis
Today's recommended one-command-to-solve-it-all command is to just run
npm i
on the root directory. Although convenient, the first step is rarely needed, and takes significant time (18%)npm i
: installs/updates dependencies on the root package (basically just lerna)npm run bootstrap
, installing packages dependencies and linking them locallynpm run build
, that after PR Updates to ethereumjs-config v2.0.0 (old) #886 will for both Node and Browser.Fixes
npm i
from root does not need to be run every timeThe root
npm i
usually deletes the contents of the rootnode_modules
, because the hoisted dependencies are not present on the rootpackage.json
, while thebootstrap
command installs them over again. Nonsense, right?If we just take the shortcut, starting directly from
npm run bootstrap
, we cut the 22s from the rootnpm i
itself, and as thenode_modules
directory is already populated, we cut another ~30s from the bootstrap itself.❇️ advice: whenever changing branches, prefer using
npm run bootstrap
overnpm i
npm i
lerna bootstrap
build
~57% of improvement so far.
Next optimization candidates
--no-audit
on npm commands--prefer-offline
to save on network requestsThe text was updated successfully, but these errors were encountered: