invoke function take long time #8172
Unanswered
Xiaobaishushu25
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Any news? the same problem |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to perform a file operation, and using writeBinaryFile will block the UI thread (does it require JavaScript multithreading?). I am not familiar with the frontend, so I want to pass the file to rust.
My process is: frontend retrieves the file → converts it to Uint8Array → invokes rust for processing.
My problem is that I found that the invoke function takes too long.
this is my frontend code:
this is my rust code,to avoid blocking threads, I used asynchronous operations:
this is run capture(the file is about 23mb),you can see that I called the rust function on the front end and it took me ten seconds to start executing the rust function.why does this take so long? Is there any solution?

Beta Was this translation helpful? Give feedback.
All reactions