emilk / emilk/egui

A design to reduce CPU usage

Open
#3,801 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

Observing app usage, it can be noticed that most of the actual unnecessary redrawings are caused by mouse movements. For example, moving the mouse over a label widget does not result in any actual changes in the UI.

A simple idea is that we can draw a UI ID texture with the same size as the interface. If the mouse moves over the same widget before and after, no redraw is triggered, as long as this widget only needs to perceive whether it is being hovered over rather than its precise position.

for example:
A -> B: mouse move on same widget, don't redraw
B -> C: mouse move on different widget, need redraw
![1](https://github.com/emilk/egui/assets/15245678/859040b6-6ab2-4766-995e-dc4f7d48b05f)
![2](https://github.com/emilk/egui/assets/15245678/691b734a-d428-4ed4-bdbb-0ad857cacf27)
![3](https://github.com/emilk/egui/assets/15245678/841cc522-7972-4e33-9e9a-e44a117b143e)

Contributor guide

Open the contributing guide

Research direction

The issue provides no file or test entry point. Study the proposed UI ID texture approach and verify that mouse moves within the same widget avoid redraws while moves between widgets still redraw, while preserving behavior for widgets that need precise hover positions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
frontend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.