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

Upload Speed seems quite slow #74

Open
Joly0 opened this issue Oct 18, 2023 · 1 comment
Open

Upload Speed seems quite slow #74

Joly0 opened this issue Oct 18, 2023 · 1 comment

Comments

@Joly0
Copy link

Joly0 commented Oct 18, 2023

Hey, i am not sure if this is 100% a hoodik issue, but it seems like it. If i try to upload a file, i get only 1/4 of the max speed of my connection. For my internet connection its 40Mbits, but i only get max 10Mbits in hoodik. If i try to connect to hoodik via local connection, without going through the internet, i get 25Mbits instead of 1Gbit which is my max local networking.

So in both cases its exactly 1/4 which cant be just a random coincedence imo. I also tested with nextcloud for example or filerun and got the max speed both times

@htunlogic
Copy link
Collaborator

htunlogic commented Oct 19, 2023

You are getting that right due to encryption overhead, which is the maximum speed currently when running in Chromium-based browsers. Firefox is a bit better and can get up to 75Mbits upload. Still, it cannot download data because of an issue in how it works with the native API of ReadableStreamDefaultReader (still trying to figure that one out).

The upload and download are chunked and done in parallel, but the issue is that the encryption is a sync operation, so it is blocking.
I did try out some other approaches that might speed this up in the future, but they are highly experimental and unstable, so those are disabled at the moment. Upload and download workers spawn their encryption workers to parallelize the encryption. Then you can get up to 400Mbits, probably even more with more workers, but this is a massive hit for the browser to handle in my experience so far, and I opted out of having that turned on for now in favor of compatibility.

Hoodik was mainly developed to cover my needs for uploading documents and sensitive data to my cloud. The speed was a priority, and that's why the encryption is done through WASM, which is currently, even in this "slow" form, much faster than the native crypto.js API.

Nextcloud does direct upload, with no encryption to utilize the full speed.

Edit: There is also an option to offload the encryption to the back-end server, but that would mean the key has to be sent to the server when uploading/downloading, and it wouldn't be any more end-to-end encryption. :)

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

No branches or pull requests

2 participants