rust-windowing / rust-windowing/winit

High CPU usage in empty application regardless of control flow

Open
#4,038 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - win32
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Hi, I'm getting ~30% CPU usage (as reported by Task Manager) for an empty application in release mode on Windows 10. The code is just the "event loop" example from the crate documentation; it doesn't matter which ControlFlow I use. I'm not moving the mouse or interacting with the window in any way.

flamegraph.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the crate documentation's event loop example on Windows 10 in release mode and reproduce the reported idle CPU usage with each ControlFlow setting. Inspect the supplied flamegraph.zip to identify where the work is occurring, then verify that an empty application no longer shows the reported high CPU usage while idle.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.