ebb-earl-co / tidal-wave

Waving at the TIDAL music service
Apache License 2.0
38 stars 2 forks source link

Possible To Increase Download Speeds #97

Closed Rajeshsahoo12 closed 6 months ago

Rajeshsahoo12 commented 7 months ago

Hi Dev,

As right now I have installed latest release of tidal-wave on windows based PC & using it. I use windows device access token to download hi-res lossless audio.

What I have experienced is slow download speeds which I never crossing 1.5 MB/s where as I have internet connection of bandwidth 80 MB/s.

Just a suggestion if it is possible to increase download speeds will be very helpful.

Thanks

ebb-earl-co commented 7 months ago

@Rajeshsahoo12 There will always be more to be done in order to increase download speed. However, it might be the case that TIDAL has a speed limit on API requests that is completely out of my hands! How have you arrived at this 1.5 MB/s figure?

Check out a new feature branch that I just created, called make-it-faster. It uses a drop-in replacement for the requests library called niquests and my very brief tests show a small speedup. Please test it out and let me know

PS > python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

Separately, I have to say that I am not versed in HTTP performance at all. I know of a few things that can help HTTP2 performance, such as better header compression with HPACK or nghttp2, and niquests implements that. Other than this, I don't have the skills currently to dissect network performance in an astute way.

Nevertheless, chasing performance gains is always fun, so I will continue to experiment on the make-it-faster branch!

Rajeshsahoo12 commented 6 months ago

@Rajeshsahoo12 There will always be more to be done in order to increase download speed. However, it might be the case that TIDAL has a speed limit on API requests that is completely out of my hands! How have you arrived at this 1.5 MB/s figure?

Check out a new feature branch that I just created, called make-it-faster. It uses a drop-in replacement for the requests library called niquests and my very brief tests show a small speedup. Please test it out and let me know

PS > python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

Separately, I have to say that I am not versed in HTTP performance at all. I know of a few things that can help HTTP2 performance, such as better header compression with HPACK or nghttp2, and niquests implements that. Other than this, I don't have the skills currently to dissect network performance in an astute way.

Nevertheless, chasing performance gains is always fun, so I will continue to experiment on the make-it-faster branch!

I have installed network speed meter program on my windows based PC which shows current network usage ( both download & upload) separately. And it shows speeds in MB/s as I have set it under preferences.

Let me try downloading make-it-faster branch & test the speeds.

ebb-earl-co commented 6 months ago

@Rajeshsahoo12 I'm seeing perhaps quite a good speedup switching from requests to httpx.

Rajeshsahoo12 commented 6 months ago

@Rajeshsahoo12 I'm seeing perhaps quite a good speedup switching from requests to httpx.

If I use this command to install make-it-faster branch. Will my default tidal-wave installation gets effected...?

PS > python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

ebb-earl-co commented 6 months ago

@Rajeshsahoo12 I'm seeing perhaps quite a good speedup switching from requests to httpx.

If I use this command to install make-it-faster branch. Will my default tidal-wave installation gets effected...?

PS > python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

Yes. You would be changing the version of tidal-wave installed. However, you could change it back at any time with

PS > python.exe -m pip install tidal-wave==2024.3.1
Rajeshsahoo12 commented 6 months ago

@Rajeshsahoo12 I'm seeing perhaps quite a good speedup switching from requests to httpx.

If I use this command to install make-it-faster branch. Will my default tidal-wave installation gets effected...? PS > python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

Yes. You would be changing the version of tidal-wave installed. However, you could change it back at any time with

PS > python.exe -m pip install tidal-wave==2024.3.1

Okay that is easy. As I have already installed make-it-faster branch now. And going try tidal link.

Rajeshsahoo12 commented 6 months ago

@ebb-earl-co Had used this command to install tidal-wave from this branch make-it-faster python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

And used various album url to download but I did not notice any change in speeds.

ebb-earl-co commented 6 months ago

@ebb-earl-co Had used this command to install tidal-wave from this branch make-it-faster python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip

And used various album url to download but I did not notice any change in speeds.

How are you measuring speeds? For me, all I do is a simple Bash time command on the same album or playlist or track, comparing between the trunk and make-it-faster branches. This isn't controlling for network conditions, so the results are not great, but I don't have a framework for network speed testing

Rajeshsahoo12 commented 6 months ago

@ebb-earl-co Had used this command to install tidal-wave from this branch make-it-faster python.exe -m pip install https://github.com/ebb-earl-co/tidal-wave/archive/make-it-faster.zip And used various album url to download but I did not notice any change in speeds.

How are you measuring speeds? For me, all I do is a simple Bash time command on the same album or playlist or track, comparing between the trunk and make-it-faster branches. This isn't controlling for network conditions, so the results are not great, but I don't have a framework for network speed testing

I had installed this tiny program on my windows based PC https://netspeedmonitor.en.softonic.com/. It measures networks traffic both inbound & outbound.

In both the branches speeds are same.

Thanks

ebb-earl-co commented 6 months ago

@Rajeshsahoo12 I have added HTTP caching support in version 2024.3.6. When you get a chance, please try it out and let me know if you see any speedup. N.b., I haven't changed the HTTP layer, but rather, when there are repeated requests to the same endpoint, tidal-wave will use the in-memory cached version instead of fetch the same response over HTTP again. This will decrease overall program execution time, but not round-trip time to the TIDAL API.

The time savings will be more pronounced on larger albums, as e.g. the artist metadata, album metadata, artist Bio will hit a cache instead of be re-fetched.