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

[bug] run-iteration high CPU usage on Windows #10373

Closed
lgou2w opened this issue Jul 24, 2024 · 2 comments
Closed

[bug] run-iteration high CPU usage on Windows #10373

lgou2w opened this issue Jul 24, 2024 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@lgou2w
Copy link

lgou2w commented Jul 24, 2024

Describe the bug

Actual usage varies by CPU. The worse the performance, the higher the usage.

Windows 10 22H2 (19045.4651)

These two screenshots are running on VirtualBox with 4 CPU cores. If the CPU core is set to 1, then run_iteration will be 100% occupied.

run_iteration.exe:
run-iteration

helloworld.exe:
helloworld

Windows 11 23H2 (22631.3880)

This is Windows 11 running on a real physical machine.

tauri-run-iteration-high-cpu.mp4

BTW

I and tried the previous version of Tauri v1. Changed the run method to run_iteration as follows. The same problem occurs:

let mut app = ...
loop {
  let iteration = app.run_iteration();
  if iteration.window_count == 0 {
    break;
  }
}

Reproduction

git clone -b dev https://github.com/tauri-apps/tauri.git
cd tauri
cargo run --example run-iteration --release
cargo run --example helloworld --release

Compare their usage in Task Manager.

Expected behavior

run_iteration.exe should be the same as helloworld.exe.

Full tauri info output

Windows 10 SDK (10.0.19041.0)

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 126.0.2592.113
    ✔ MSVC: Visual Studio 生成工具 2022
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10)
    ✔ cargo: 1.79.0 (ffa9cf99a 2024-06-03)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.15.1
    - pnpm: 9.5.0
    - npm: 9.6.5

[-] Packages
    - tauri [RUST]: 2.0.0-beta.24
    - tauri-build [RUST]: 2.0.0-beta.19
    - wry [RUST]: 0.41.0
    - tao [RUST]: 0.28.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.15
    - @tauri-apps/cli [NPM]: 2.0.0-beta.22

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

@lgou2w lgou2w added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jul 24, 2024
@FabianLars
Copy link
Member

Thanks for the report! I think this is a duplicate of #8631 :)

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
@lgou2w
Copy link
Author

lgou2w commented Jul 24, 2024

Thanks for the report! I think this is a duplicate of #8631 :)

Thanks for the reply. I apologize for not searching to see that the issue already existed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants