readBinaryFile
immensely slow
#2487
Replies: 2 comments 1 reply
-
We are actually working on this right now, especially because we discovered unintended memory bloat and aren't doing streaming. Perhaps @lemarier can add more insight. |
Beta Was this translation helpful? Give feedback.
-
btw, just to clear things up. The issue doesn't say that it only takes 40ms. He said that in total it took 400ms in release mode for the file to arrive on the js side (40ms reading, 110ms serializing, rest is transport i guess). (btw i measured ~390ms for 2.3MB with readBinaryFile and ~90ms with readTextFile.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The issue in #1817 does not seem to be resolved yet or I somehow couldn't get the same results. I have made some testing and it just isn't fast compared to native browser functions.
I have made a new project using
create-tauri-app
with the react framework and have made a basicreadBinaryFile
function that reads a 2MB file on my PC. During debug, it took 5 seconds to return the promise, in release it took around 500 ms. It is nothing compared to the aforementioned issue stating 40 ms for 3 MB. In the browser, with a file input it takes less than 10 ms usingreadAsArrayBuffer
.Beta Was this translation helpful? Give feedback.
All reactions