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

[Feature]: Set or Get the WebView2 Control thread priority. #4610

Open
PCRacer opened this issue Jun 4, 2024 · 2 comments
Open

[Feature]: Set or Get the WebView2 Control thread priority. #4610

PCRacer opened this issue Jun 4, 2024 · 2 comments
Assignees
Labels
feature request feature request tracked We are tracking this work internally.

Comments

@PCRacer
Copy link

PCRacer commented Jun 4, 2024

Describe the feature/enhancement you need

I would like to simply call a function or procedure to set or get the WebView2 control's thread priority in order to match the WIN32 app's thread priority.

Simply put, I would like to escalate or deescalate the thread priority of the WebView2's instance to match to that of the WIN32 app running on it.

The scenario/use case where you would use this feature

This will enable high performance or normal system apps to function at the PC's highest or lowest capability, either for power conservation or high speed calculations or data search/manipulation at maximum CPU speed available.

How important is this request to you?

Very Important, as there is no way in accessing the WebView2 control's handle in order to set its thread priority!

Suggested implementation

Operation:

WebView2.ThreadPriority.SetPriority = IDLE_PRIORITY_CLASS
WebView2.ThreadPriority.SetPriority = NORMAL_PRIORITY_CLASS
WebView2.ThreadPriority.SetPriority = HIGHEST_PRIORITY_CLASS . . . . etc.

Var WebViewPriority: Integer;

WebViewPriority = WebView2.ThreadPriority.GetPriority;

What does your app do? Is there a pending deadline for this request?

This will also be more advantageous for online gamers or high performance stock trading systems in order to reduce latency and increase operational application speed for maximum data search and/or manipulation or feedback of data from an online database.

This will also be most advantageous for low power systems to conserve energy when running on battery power. The battery power switch from AC will be detected by the app and accordingly lower the WebView2 control's thread priority in order to further reduce energy consumption and speed of operation.

AB#52578898

@PCRacer PCRacer added the feature request feature request label Jun 4, 2024
@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Jul 18, 2024
@champnic
Copy link
Member

✅ Successfully linked to Azure Boards work item(s):

@LiangTheDev
Copy link
Member

Added a tracking work item. We will triage it. There are multiple processes involved in WebView2, so it is more complicated than simply setting a priority on webview thread.

The current behavior is that we try to automatically boost related renderer process when the app is in foreground and the app could set the WebView2 to be invisible to lower its resource usage, or even suspend it if not running any web code at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants