forked from wez/wezterm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This improves the startup time. Right now we query the portal appearance value again over dbus every time that we access it, for example every time that the user calls wezterm.gui.get_appearance() from the Lua interface. Queries over dbus are slow, they usually take a few milliseconds to complete, for example on my system a portal query over dbus takes around 2 milliseconds to complete. Wezterm also automatically calls the portal during its own internal x11/wayland connection initialization, thus right now wezterm queries the appearance portal setting n+1 times on startup, where n is the number of times that the user calls get_appearance() from the config. To fix this problem, we simply cache the portal appearance. Thus this patch decreases the startup time by 2ms for users that configure wezterm to follow the global system theme and potentially by more for users that call get_appearance() in inflational amounts. Of course in order to prevent our cached value from going invalid, we have to track the appearance value by subscribing to the SettingChanged signal which we did already anyway. refs: wez#2258
- Loading branch information
Showing
4 changed files
with
71 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters