-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[bug] Transfer rate from backend is very slow #4197
Comments
Alright, the reason for this is rather simple. Every file in your Edit: Sidenote: You might want to use the gif as a resource instead. (Or use an .mp4 file, since afaik range requests are supported for those) |
Ok, except I see the same timing when loading an external fie from disk using a custom protocol. Reading the file into memory takes minimal time, but the transfer takes 3 minutes. |
Just to be clear, my goal is to browse arbitrary images on the user's computer. Including it in the build was just a simple way of demonstrating the issue. In the end, I'm using an embedded Tide webserver to serve external files. Here is the timing: In the attached sources, I've included both implementations. Simply change index.html to refer to the file on your local machine. This is 175x slowdown to use the custom protocol, so I'll be using the local server for my app. |
Similar problem here. Tauri appears to be 200x slower than Electron loading the same file. |
Chiming in with the fact that I switched https://github.com/mikedilger/gossip from Tauri to egui back in December after a week of failing to debug or work around the tremendously slow performance surrounding transferring an updated vector of hashes to javascript. I didn't understand how to debug it. So I switched to egui and it was instant. Never looked back. |
I have a similar problem, working on a project with a friend, for me, it takes more than 1 min to download a 25Mb PNG, but for my friend only 2ms, also reloading the UI during dev sometimes takes like 15s to load with a white screen and for my friend merely half a second. tauri 1.2.2 |
I also have a similar problem,transfer 23mb file take about 10s,is serialization of binary data causing this issue? |
"During that time, the window was hung -- could not even get to development tools." As soon as I adjust my Windows process priority to high/realtime the issue becomes far less pronounced and I get far more stable performance between the webviews and tauri. Making about ~100MB transfer in a second or two. 5MB across 20+ windows with only some jittery framerate on windows, no lock ups. Very odd. I am hoping this resolves the issues with the userbase on this issue. Sorry for no benchmarks or technical info, but I thought I'd share what I've found. |
+1 Just loading image (6.2MB) from an external source takes forever , compared to the browser. Anything we can do? |
you can try tauriV2( #9322 ) |
It's a known issue that IPC call in Tauri V1 is slow (tauri-apps/tauri#4197) Specifically, writeBinaryFile can take several seconds if the file is around like 10 MB because of some internal serealization bottleneck of Tauri. This is really bad as we use writebinaryFile every second to save database. This PR just create separate http server only handling the bottleneck part: writebinaryfile of database.bin and assets.
Describe the bug
First, I apologize if this would not actually be considered a bug, as it is a performance issue. But it was so bad that it made me think it was a bug at first.
Loading a 148MB .gif file took 194987.2ms (3.2 minutes). (Linux on Ryzen 7 5800u 16GB). One core on my machine was at 100% @4.4 GHz the entire time. This works out to about 1.3MB/s transfer rate. During that time, the window was hung -- could not even get to development tools.
I originally came upon the problem using a custom protocol handler, so I know that reading the file into memory took almost no time; it was all transfer time.
I don't have exact times for the release build, since I can't use development tools, but it was comparable timing. (And after updating to rc11 from rc07, I can no longer build the release version with this large file in it.)
For comparison, NW.js (which I'm porting from) loads this in less than 2 seconds. Brave browser with 100MB/s internet also loads the file in about 2 seconds.
All in all, I am loving Tauri, and this doesn't really affect most assets. But I thought you should be aware of the issue.
Reproduction
Start a new project with: yarn create tauri-app
Use this index.html:
<!DOCTYPE html>
<body>
<img src="Mghhw6X.gif">
</body>
Put this file in dist (it's too large to post to github):
https://i.imgur.com/Mghhw6X.gif
yarn tauri dev
Expected behavior
Mghhw6X.gif should appear in window in 2 -3 seconds.
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: