alacritty: Slow startup after upgrading to 0.13.0.
After upgrading to version 0.13.0 this morning and converting the .yml configuration to .toml, my terminal experiences a delay of about 3 seconds during the initial startup. After the first instance is up, the startup time for subsequent instances is super fast. However, after some minutes, the newly spawned terminal is delayed again, even though there is already a running instance.
$ for i in $(seq 0 10); do time alacritty -e echo; done 2>&1 | grep real
real 0m2.529s
real 0m0.166s
real 0m0.166s
real 0m0.177s
real 0m0.174s
real 0m0.174s
real 0m0.164s
real 0m0.179s
real 0m0.180s
real 0m0.171s
real 0m0.189s
Here is the output of strace -T alacritty -e false, where the poll() operation takes 2.3 seconds: log.txt
...
poll([{fd=3, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=3, revents=POLLOUT}]) <0.000008>
writev(3, [{iov_base="\214\10\2\0[\5\0\0", iov_len=8}], 1) = 8 <0.000009>
poll([{fd=3, events=POLLIN}], 1, -1) = 1 ([{fd=3, revents=POLLIN}]) <2.334551>
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0\341\0\255\0\0\0!b\0\0!b\0\0\t\0\2\0\20\0\210\0\0\0\0\0\0\0\0\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 836 <0.000021>
...
System
OS: Arch Linux x86_64 6.6.8-arch1-1 Version: alacritty 0.13.0 (78fa4d6f) Linux: X11, AwesomeWM, no compositor CPU: AMD Ryzen 5 5600H with Radeon Graphics (12) @ 4.280GHz GPU: AMD ATI Radeon RX 5500/5500M / Pro 5500M GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series
Config
[font]
size = 8.0
[font.bold]
family = "Fira Code"
style = "Bold"
[font.bold_italic]
family = "Fira Code"
style = "Bold Italic"
[font.italic]
family = "Fira Code"
style = "Italic"
[font.normal]
family = "Fira Code"
style = "Regular"
[[keyboard.bindings]]
action = "CreateNewWindow"
key = "N"
mods = "Control|Shift"
[window.padding]
x = 5
y = 0
Logs
Crashes: No
Font/Terminal size: alacritty -vv
[0.000004428s] [INFO ] [alacritty] Welcome to Alacritty
[0.000046527s] [INFO ] [alacritty] Version 0.13.0 (78fa4d6f)
[0.000056666s] [INFO ] [alacritty] Running on X11
[0.000302536s] [INFO ] [alacritty] Configuration files loaded from:
"/home/meo/.config/alacritty/alacritty.toml"
[0.004251665s] [INFO ] [alacritty] Using GLX 1.4
[0.035732874s] [DEBUG] [alacritty] Picked GL Config:
buffer_type: Some(Rgb { r_size: 8, g_size: 8, b_size: 8 })
alpha_size: 8
num_samples: 0
hardware_accelerated: true
supports_transparency: Some(true)
config_api: Api(OPENGL | GLES1 | GLES2)
srgb_capable: false
[2.379749191s] [INFO ] [alacritty] Window scale factor: 1.5
[2.380777575s] [DEBUG] [alacritty] Loading "Fira Code" font
[2.413275477s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.430887037s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.449586392s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.467498184s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.471062032s] [INFO ] [alacritty] Running on AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.54, 6.6.8-arch1-1)
[2.471074956s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[2.471086638s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[2.475114052s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[2.475192670s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[2.483605830s] [INFO ] [alacritty] Cell size: 10 x 20
[2.483622782s] [INFO ] [alacritty] Padding: 7 x 0
[2.483630306s] [INFO ] [alacritty] Width: 800, Height: 600
[2.484910100s] [INFO ] [alacritty] PTY dimensions: 30 x 78
[2.487822830s] [INFO ] [alacritty] Initialisation complete
[3.696621222s] [INFO ] [alacritty] Goodbye
Keyboard and bindings: alacritty --print-events
[0.000004378s] [INFO ] [alacritty] Welcome to Alacritty
[0.000048681s] [INFO ] [alacritty] Version 0.13.0 (78fa4d6f)
[0.000069911s] [INFO ] [alacritty] Running on X11
[0.000357319s] [INFO ] [alacritty] Configuration files loaded from:
"/home/meo/.config/alacritty/alacritty.toml"
[0.001977821s] [INFO ] [alacritty] winit event: NewEvents(Init)
[0.001993159s] [INFO ] [alacritty] winit event: Resumed
[0.003701947s] [INFO ] [alacritty] Using GLX 1.4
[2.372697339s] [INFO ] [alacritty] Window scale factor: 1.5
[2.460093040s] [INFO ] [alacritty] Running on AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.54, 6.6.8-arch1-1)
[2.460122966s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[2.460128116s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[2.472511284s] [INFO ] [alacritty] Cell size: 10 x 20
[2.472533876s] [INFO ] [alacritty] Padding: 7 x 0
[2.472539907s] [INFO ] [alacritty] Width: 800, Height: 600
[2.476853658s] [INFO ] [alacritty] PTY dimensions: 30 x 78
[2.480556887s] [INFO ] [alacritty] Initialisation complete
[2.480580531s] [INFO ] [alacritty] winit event: DeviceEvent { device_id: DeviceId(X(DeviceId(13))), event: Key(RawKeyEvent { physical_key: Code(Enter), state: Released }) }
[2.480608393s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Ime(Enabled) }
[2.480740670s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Focused(false) }
[2.480755939s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[2.490594256s] [INFO ] [alacritty] winit event: AboutToWait
[2.490652785s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 113296395 }, requested_resume: Some(Instant { tv_sec: 6077, tv_nsec: 120193607 }) })
[2.490789321s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Moved(PhysicalPosition { x: 0, y: 20 }) }
[2.490812424s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Resized(PhysicalSize { width: 800, height: 600 }) }
[2.491038367s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Occluded(false) }
[2.491116844s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: Focused(true) }
[2.491125239s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 610.0, y: 487.0 } } }
[2.491383202s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: CursorEntered { device_id: DeviceId(X(DeviceId(2))) } }
[2.491393111s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: CursorMoved { device_id: DeviceId(X(DeviceId(2))), position: PhysicalPosition { x: 610.0, y: 487.0 } } }
[2.491412717s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[2.495907196s] [INFO ] [alacritty] winit event: AboutToWait
[2.495938084s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 118593455 }, requested_resume: Some(Instant { tv_sec: 6077, tv_nsec: 120193477 }) })
[2.495954965s] [INFO ] [alacritty] winit event: AboutToWait
[2.497536304s] [INFO ] [alacritty] winit event: NewEvents(ResumeTimeReached { start: Instant { tv_sec: 6077, tv_nsec: 118630034 }, requested_resume: Instant { tv_sec: 6077, tv_nsec: 120193477 } })
[2.497548747s] [INFO ] [alacritty] winit event: AboutToWait
[2.497571049s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 120233734 }, requested_resume: None })
[2.497580497s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[2.497589984s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[2.497603400s] [INFO ] [alacritty] winit event: AboutToWait
[2.596430729s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 120280101 }, requested_resume: None })
[2.596457409s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Title(meo@arch:~/tmp)) })
[2.596468409s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[2.596478358s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[2.597627909s] [INFO ] [alacritty] winit event: AboutToWait
[2.597655079s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 220313476 }, requested_resume: None })
[2.597899747s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[2.597916278s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[2.597928090s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[2.599278887s] [INFO ] [alacritty] winit event: AboutToWait
[2.601696420s] [INFO ] [alacritty] winit event: NewEvents(ResumeTimeReached { start: Instant { tv_sec: 6077, tv_nsec: 221965627 }, requested_resume: Instant { tv_sec: 6077, tv_nsec: 224353811 } })
[2.601710968s] [INFO ] [alacritty] winit event: AboutToWait
[2.601722439s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 224385525 }, requested_resume: None })
[2.601729442s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[2.601734842s] [INFO ] [alacritty] winit event: AboutToWait
[3.080116773s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 224407546 }, requested_resume: None })
[3.080411274s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: ModifiersChanged(Modifiers { state: ModifiersState(CONTROL), pressed_mods: ModifiersKeys(0x0) }) }
[3.080463892s] [INFO ] [alacritty] winit event: AboutToWait
[3.080860394s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 703233067 }, requested_resume: None })
[3.080939131s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: KeyboardInput { device_id: DeviceId(X(DeviceId(3))), event: KeyEvent { physical_key: Code(ControlLeft), logical_key: Named(Control), text: None, location: Left, state: Pressed, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Named(Control), text_with_all_modifiers: None } }, is_synthetic: false } }
[3.080962134s] [INFO ] [alacritty] winit event: AboutToWait
[3.215969334s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 703641992 }, requested_resume: None })
[3.216174397s] [INFO ] [alacritty] winit event: AboutToWait
[3.216637604s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 838856589 }, requested_resume: None })
[3.216847717s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: KeyboardInput { device_id: DeviceId(X(DeviceId(3))), event: KeyEvent { physical_key: Code(KeyC), logical_key: Character("c"), text: Some("c"), location: Standard, state: Pressed, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Character("c"), text_with_all_modifiers: Some("\u{3}") } }, is_synthetic: false } }
[3.216885648s] [INFO ] [alacritty] winit event: AboutToWait
[3.217172956s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 839585032 }, requested_resume: None })
[3.217224682s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.217238619s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.217246123s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Title(meo@arch:~/tmp)) })
[3.217254148s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.217263836s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[3.219674846s] [INFO ] [alacritty] winit event: AboutToWait
[3.219708630s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 842363460 }, requested_resume: None })
[3.220031974s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.220047263s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[3.220075245s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[3.221189841s] [INFO ] [alacritty] winit event: AboutToWait
[3.221215960s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 843873786 }, requested_resume: None })
[3.221230196s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[3.221238251s] [INFO ] [alacritty] winit event: AboutToWait
[3.365321502s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 843913280 }, requested_resume: None })
[3.365575407s] [INFO ] [alacritty] winit event: AboutToWait
[3.365949817s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 988267647 }, requested_resume: None })
[3.366068540s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: KeyboardInput { device_id: DeviceId(X(DeviceId(3))), event: KeyEvent { physical_key: Code(KeyC), logical_key: Character("c"), text: Some("c"), location: Standard, state: Released, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Character("c"), text_with_all_modifiers: Some("\u{3}") } }, is_synthetic: false } }
[3.366108685s] [INFO ] [alacritty] winit event: AboutToWait
[3.561178437s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6077, tv_nsec: 988788101 }, requested_resume: None })
[3.561375215s] [INFO ] [alacritty] winit event: AboutToWait
[3.561882093s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6078, tv_nsec: 184063067 }, requested_resume: None })
[3.562025952s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: KeyboardInput { device_id: DeviceId(X(DeviceId(3))), event: KeyEvent { physical_key: Code(KeyD), logical_key: Character("d"), text: Some("d"), location: Standard, state: Pressed, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Character("d"), text_with_all_modifiers: Some("\u{4}") } }, is_synthetic: false } }
[3.562057361s] [INFO ] [alacritty] winit event: AboutToWait
[3.562301508s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6078, tv_nsec: 184750944 }, requested_resume: None })
[3.562339168s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.562352744s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(62914565)), event: RedrawRequested }
[3.563693292s] [INFO ] [alacritty] winit event: AboutToWait
[3.563721935s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 6078, tv_nsec: 186379180 }, requested_resume: None })
[3.563740891s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Exit) })
[3.568134100s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Terminal(Wakeup) })
[3.568155741s] [INFO ] [alacritty] winit event: UserEvent(Event { window_id: Some(WindowId(WindowId(62914565))), payload: Frame })
[3.568164176s] [INFO ] [alacritty] winit event: AboutToWait
[3.568172512s] [INFO ] [alacritty] winit event: LoopExiting
[3.569863927s] [INFO ] [alacritty] Goodbye
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Reactions: 4
- Comments: 41 (21 by maintainers)
Commits related to this issue
- Bump winit to 0.29.8 Fixes #7514. Fixes #7502. Fixes #7494. Fixes #7474. Fixes #7472. — committed to kchibisov/alacritty by kchibisov 6 months ago
- Bump winit to 0.29.8 Fixes #7514. Fixes #7502. Fixes #7494. Fixes #7474. Fixes #7472. — committed to chrisduerr/alacritty by kchibisov 6 months ago
- Bump winit to 0.29.8 Fixes #7514. Fixes #7502. Fixes #7494. Fixes #7474. Fixes #7472. — committed to alacritty/alacritty by kchibisov 6 months ago
- Bump winit to 0.29.8 Fixes #7514. Fixes #7502. Fixes #7494. Fixes #7474. Fixes #7472. — committed to luisriverag/alacritty by kchibisov 6 months ago
@psychon, your patch is good; the delayed startup is gone. Here is the patch that I applied based on your guide:
Could you
git checkout 6071a7bf
(the last working commit), and then apply this patch:I’d expect it to fail, and then apply this
This thing should probably work.
Already rebooted; the issue persists. Switched to the old version 0.12.3, and it works perfectly with no delays.
WezTerm also affected.
Here is your requested info:
From the original comment:
Yay, decoding raw X11 data is always fun. So, the
writev(3, [{iov_base="\214\10\2\0[\5\0\0", iov_len=8}], 1)
is major opcode\214
. Assuming I got my octal right, that’s decimal 140.printf %o\\n 140
in a terminal confirms this.@hitori1403 Could you run this again and without rebooting, run
$ xdpyinfo -queryExtensions | grep opcode
? The opcodes are dynamically assigned when the X11 server is starting. For my currently running X11 server, this opcode is from RANDR, which would make a bit of sense.Next, minor opcode is
\10
, so 8. That would then be a GetScreenResources request, which is known to be sometimes slow.The next two bytes are the length of the request (2 four-byte-units) and the root window that the request is sent to (too lazy to decode that and I don’t really care).
So, assuming opcode 140 is RANDR for @hitori1403 , too, this would come from this code: https://github.com/rust-windowing/winit/blob/ca1674519ab3d8df4ce231fe018196a3981c7dea/src/platform_impl/linux/x11/monitor.rs#L355
@hitori1403 Could you also run
xrandr --version
?:I am asking, because the above code is supposed to be unreachable. RandR 1.3 added a faster way for querying screen information that just queries from the X11 server’s cache and does not have to (slowly) query the hardware again.
Uhm… actually. https://github.com/rust-windowing/winit/blob/ca1674519ab3d8df4ce231fe018196a3981c7dea/src/platform_impl/linux/x11/monitor.rs#L347 This code is fishy. You are telling the X11 server that the newest RandR version you support is version 0.0. I’ll ignore the fact that this does not exist, but the Xorg server might actually listen to this and disable newer features. Or at least it won’t tell you about a newer version than you asked for. https://gitlab.freedesktop.org/xorg/xserver/-/blob/f59871587ea678d4c498874895f4b97687764ee1/randr/rrdispatch.c#L50-59
One of the people here could cook up a patch / experiment to change that
randr_query_version(0, 0)
torandr_query_version(1, 3)
(or whatever version of randr winit actually “hopes for”).Edit:
Try 0.12.3 again. This is almost certainly a driver initialization issue.