Healix / Gw2Launcher

Manages and allows for multiple Guild Wars 2 clients to be launched
MIT License
180 stars 24 forks source link

request: process priority + affinity of CefHost.exe #323

Open wharlox opened 1 year ago

wharlox commented 1 year ago

a seperate global and per-app setting to explicitly set the process priority and affinity for CefHost.exe would be wonderful; sadly I think it would need to be a continually running task to continually check number of sub-processes of gw2-64.exe and then set said values after they are spawned (though that is assuming the exe is spwaned many times, and as often as it crashes, i guess so).

i hope to test out something like this via a powershell script; oof but you know, its powershell (and i'll get to it later)

Healix commented 1 year ago

What's the goal? CefHost is idle and its renderer process is shutdown when it's not in use, so changing its priority isn't going to have any impact until you open the BLTC.

wharlox commented 1 year ago

the goal is to limit its impact on overal cpu and deprioritize it; when i loadup my alts i dont want 4-5x child processes being more available than the game itself.

I dont think cef is strictly BLTC and seems more widely used; i've had it crash a number of times and makes any gw2-ui window unresponseive, up until i close said ui and re-open it

Healix commented 1 year ago

It's used by the launcher, BLTC, guild hall upgrades and books. It's also started on character select and loading screens, but not actually used (a remnant from when they showed news). It shouldn't have any noticeable CPU usage unless what it's displaying is constantly changing. For example, if you open the BLTC, it'll spike initially, then go down to 0, then spike again if you were to move the mouse around to cause the buttons to animate.

Currently I have GW2 and CoherentUI/CEF set to a high priority and lowered back to normal while the email and password is being entered. When GW2 is in the background and something else is maxing the CPU, GW2 will skip or take several seconds to respond to input.

If you want to test what it would be like to not have it at all, launch with -usecoherent and kill the main CoherentUI_Host.exe process. For a similar effect for CEF, you can simply rename CefHost.exe after loading character select, then GW2 won't be able to start the renderer.

Healix commented 1 year ago

I already had this implemented as the option to prioritize CoherentUI, which set it to a high priority. I changed the option to allow you to set the priority and also added the affinity. You can find it under Settings > Guild Wars 2 or Edit > Launch options > Processor.

I had to do it anyways, as I tacked on a solution for GW2 not always closing CefHost.exe on exit.