Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up node install from ~60s to ~5s #52

Closed
wants to merge 1 commit into from

Conversation

indirect
Copy link

@indirect indirect commented Aug 9, 2023

If you download the tarball of the master branch, it’s throttled to like 50kb/sec, and downloading the tarball takes 20-60 seconds. If you download the tarball of the latest tagged release, it does not seem to be throttled at all, and reduces the amount of time the "install node" step takes on my machine down to about 5 seconds total.

If you download the tarball of the master branch, it’s throttled to like 50kb/sec, and downloading the tarball takes 20-60 seconds. If you download the tarball of the latest tagged release, it does not seem to be throttled at all, and reduces the amount of time the "install node" step takes on my machine down to about 5 seconds total.
@rubys
Copy link
Collaborator

rubys commented Aug 10, 2023

Because it is an erb file you may need two backslashes in cut -d\" -f4.

Also, this changes expected test results. You can generate new results using rake test:capture and commit those results.

@rubys
Copy link
Collaborator

rubys commented Aug 10, 2023

Testing this out on fly.io:

root@328731ef5e5985:/rails# time curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | wc -c
330185

real	0m0.163s
user	0m0.022s
sys	0m0.011s

vs

root@328731ef5e5985:/rails# time curl -sL "$(curl -s https://api.github.com/repos/nodenv/node-build/releases/latest | grep 'tarball_url' | cut -d\" -f4)" | wc -c
330008

real	0m0.321s
user	0m0.052s
sys	0m0.005s

@indirect
Copy link
Author

Whoa, maybe I ran into a temporary GitHub rate limit? If Fly builders aren't getting rate limited by GitHub, this doesn't seem like a good change. Thanks for testing it yourself!

@indirect indirect closed this Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants