tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
78.1k stars 2.31k forks source link

[bug] Invoke function takes unusually long time to return a large Vec<u8> image data. #9654

Closed deepushajia closed 2 weeks ago

deepushajia commented 2 weeks ago

Describe the bug

I tracked all time of executions. The image was processed at rust end in a reasonable time but there exists an unusual delay between sending and receiving on the display built using React.

Reproduction

No response

Expected behavior

Fast Send.

Full tauri info output

[✔] Environment
    - OS: Ubuntu 20.04 X64
    ✔ webkit2gtk-4.0: 2.38.6
    ✔ rsvg2: 2.48.9
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ Cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.9.0
    - npm: 10.1.0

[-] Packages
    - tauri [RUST]: 1.6.1
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.8
    - tauri-cli [RUST]: not installed!
    - @tauri-apps/api [NPM]: 1.5.0 (outdated, latest: 1.5.4)
    - @tauri-apps/cli [NPM]: 1.5.1 (outdated, latest: 1.5.12)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../build
    - devPath: http://localhost:3001/
    - framework: React

Stack trace

No response

Additional context

No response

FabianLars commented 2 weeks ago

This is not something we can fix in v1, but one of the main things we worked on for v2. It's still not perfect, see https://github.com/tauri-apps/tauri/issues/9190

FutureExcited commented 2 weeks ago

Not sure if it's related, but currently I'm having the same trouble in Tauri v1, but with a regular text data - it takes insane amount of time to display.

Now, the good thing is that I figured out that it happens when the window is not focused. The second I click on it again, it instantly shows.

Obviously not saying this is the cause, but perhaps you have this type of problem as well, you should try refocusing the window again.

As for this problem, I will make a new issue tomorrow morning to describe it.