-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
Multimonitor startup delay on X11 #5802
Comments
Try putting your test configuration file in a directory that isn't modified during startup. That will eliminate the extraneous configuration reloads. In general: there isn't much we can do about X11/XRandR being slow at returning information on startup, so I'm not sure that there is really anything to fix here. |
🤦♂️ I'm sorry, did not consider that. In deed, the reloads are gone now. So it's really X11, which costs us 0.4 secs at startup just to deliver that ScreenInfo.
And I guess that info can't be hardcoded in the config file. So yeah, thanks Wez! Finally the first reason to consider wayland ✨ |
related issue: wez#5802 requesting `GetScreenResourcesCurrent` instead of `GetScreenResources` brings startup times down from 1.5 seconds to 30 microseconds on my machine (measured with dumb printlns). according to some findings `GetScreenResourcesCurrent` may return nothing, so i kept `GetScreenResources` there as a fallback, just in case, although I'm not 100% sure that it's necessary. see: - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbscreen.cpp#L963 - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbconnection_screens.cpp#L390 also worth to note that i3 does not rely on `xcb_randr_get_screen_resources`, but only on `xcb_randr_get_screen_resources_current`, see: - https://github.com/search?q=repo%3Ai3%2Fi3%20get_screen_resources&type=code
related issue: wez#5802 requesting `GetScreenResourcesCurrent` instead of `GetScreenResources` brings startup times down from 1.5 seconds to 30 microseconds on my machine (measured with dumb printlns). according to some findings `GetScreenResourcesCurrent` may return nothing, so i kept `GetScreenResources` there as a fallback, just in case, although I'm not 100% sure that it's necessary. see: - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbscreen.cpp#L963 - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbconnection_screens.cpp#L390 also worth to note that i3 does not rely on `xcb_randr_get_screen_resources`, but only on `xcb_randr_get_screen_resources_current`, see: - https://github.com/search?q=repo%3Ai3%2Fi3%20get_screen_resources&type=code
related issue: #5802 requesting `GetScreenResourcesCurrent` instead of `GetScreenResources` brings startup times down from 1.5 seconds to 30 microseconds on my machine (measured with dumb printlns). according to some findings `GetScreenResourcesCurrent` may return nothing, so i kept `GetScreenResources` there as a fallback, just in case, although I'm not 100% sure that it's necessary. see: - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbscreen.cpp#L963 - https://github.com/qt/qtbase/blob/c234700c836777d08db6229fdc997cc7c99e45fb/src/plugins/platforms/xcb/qxcbconnection_screens.cpp#L390 also worth to note that i3 does not rely on `xcb_randr_get_screen_resources`, but only on `xcb_randr_get_screen_resources_current`, see: - https://github.com/search?q=repo%3Ai3%2Fi3%20get_screen_resources&type=code
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
What Operating System(s) are you seeing this problem on?
Linux X11
Which Wayland compositor or X11 Window manager(s) are you using?
dwm
WezTerm version
wezterm 20240701-070926-69686f45 (also wezterm 20240203-110809-5046fc22)
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
Just additional infos to the startup delay, maybe useful for you (?)
Please close this if its not a bug / not helpful.
Problem
See also: #2339 and #2073. My xrandr is fast.
Test Setup
Ran these, with hdmi cable plugged in (slow) and pulled out (fast):
with
Then I normalized the timestamps, to show the offset from 0, not the absolute time.
Findings
No sign. deviation between app image and fedora rpm
No sign. deviation between stable and nightly
Looking into the perf files, I noticed these:
Discussion
RequestedWindowGeometry
.window::connection Screens { main: ScreenInfo ....
(note: I just pulled the hdmi cable, w/o reconfiguring the monitors, which explains why HDMI is still reported by ScreenInfo)0.206 🟥DEBUG config > paths "." changed, reload config, ...)
(note: I marked that with 🟥 in the screenshot) - and looses 0.4 seconds untilScreens
is showing up.I don't know, if
ScreenInfo
would come faster, if you could prevent that 2x reloading of the config - or if it does anyway not matter and X11 is just that slow delivering the info. If so, maybe you could allow to specify it, for wezterm, in the config file? Just an idea which I would gladly accept if startup would be as fast as single monitor, then 😊The 2 Testfiles are attached.
Thanks for wezterm!
wezperf.zip
To Reproduce
See above test setup
Configuration
See above - test setup.
Expected Behavior
Avoid loading the config 2 times, maybe that makes multimonitor X11 starts 0.4 secs faster (?)
Logs
See above the zip of the trace perf
Anything else?
No response
The text was updated successfully, but these errors were encountered: