Downloading a specific version of dfx is really slow

While waiting for dfxvm to come out, this is how I currently download a specific dfx version DFX_VERSION=<version_I_want> sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

Right now, downloading a specific version of dfx takes a super long time.

For example, I started downloading dfx, then realized it was taking a long time, searched for an answer on the forums, decided to write up this forum post, took this screenshot, and published the post all while dfx was still installing.

Screenshot 2023-11-26 at 15.28.27

2 Likes

This is ‘just’ a curl to a file on raw.githubusercontent.com. Do you think this is a problem specific to dfx?

2 Likes

Is there a more performant url (cdn hosted) that different dfx versions are hosted at? Just curious if you’re including something along these lines for dfxvm

we don’t currently utilize a CDN in front of github. our goal with dfxvm is to support package manager installation (e.g. homebrew, apt). when we get to this stage, we can consider utilizing a CDN (e.g. cloudflare) to speed up download times

1 Like

The reason why I brought this up is that early last year (2022), I remember downloading dfx used to take 5-15 seconds, whereas now it can take up to 3-4 minutes. I’m not sure if this is due to the size of the repository/dfx, or something else that can be improved. I’m not a new IC developer, but I’d imagine that a longer download is a friction point when it comes to developer adoption.

It definitely shouldn’t take 4 minutes. We will look into this.

Do you switch dfx version frequently or only when upgrading?

I personally have to switch a lot, but I make use of the fact that dfx is cached in e.g. ~/.cache/dfinity/versions/0.14.4/dfx to skip downloading if I am switching to a version I have installed before.