Skip to content

Commit

Permalink
Faster "npm install" without progress bar
Browse files Browse the repository at this point in the history
In older versions of npm, displaying a progress bar considerably slows
down "npm install" commands: npm/npm#11283

In Ubuntu 16.04 (supported by open edx) the default version of npm is
3.5.2, so it is affected this issue. The progress bar can be deactivated
globally by running "npm set progress=false", but this is a little-known
command.

With this change, all edx-platform developers benefit from the speed
increase. On a production server with excellent bandwidth, we made the
following benchmark:

rm -rf ./node_modules ~/.npm && npm set progress=false && time npm
install
real    3m29.980s
user    2m36.152s
sys     0m20.868s

rm -rf ./node_modules ~/.npm && npm set progress=true && time npm
install
real    7m5.580s
user    6m2.824s
sys     0m20.304s

There is thus a ~57% improvement on a task that is typically quite
time-consuming, with minimal inconvenience for developers.
  • Loading branch information
regisb committed Dec 20, 2018
1 parent e90ce3a commit 9d00c87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ fetch-retries = 5
fetch-retry-factor = 2
fetch-retry-mintimeout = 10000
fetch-retry-maxtimeout = 60000
progress = false

0 comments on commit 9d00c87

Please sign in to comment.