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

Most upvoted comments

@psychon, your patch is good; the delayed startup is gone. Here is the patch that I applied based on your guide:

diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index ad732cfd..dafd18f8 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -39,7 +39,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.29.7", default-features = false, features = ["rwh_05", "serde"] }
+winit = { git = "https://github.com/hitori1403/winit", default-features = false, features = ["rwh_05", "serde"] }

 [build-dependencies]
 gl_generator = "0.14.0"
$ target/release/alacritty -vv -e false
Created log file at "/tmp/Alacritty-43853.log"
[0.000001885s] [INFO ] [alacritty] Welcome to Alacritty
[0.000047212s] [INFO ] [alacritty] Version 0.14.0-dev (91e3cd6a)
[0.000056711s] [INFO ] [alacritty] Running on X11
[0.000314285s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/meo/.config/alacritty/alacritty.toml"
[0.003836731s] [INFO ] [alacritty] Using GLX 1.4
[0.034186541s] [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
[0.036256986s] [INFO ] [alacritty] Window scale factor: 1.5
[0.037077271s] [DEBUG] [alacritty] Loading "Fira Code" font
[0.068770269s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.086062343s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.103802798s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.120613246s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[0.124520237s] [INFO ] [alacritty] Running on AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.54, 6.6.8-arch1-1)
[0.124536301s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[0.124542587s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[0.129140657s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[0.130335502s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[0.139082145s] [INFO ] [alacritty] Cell size: 10 x 20
[0.139100933s] [INFO ] [alacritty] Padding: 7 x 0
[0.139108685s] [INFO ] [alacritty] Width: 800, Height: 600
[0.144409080s] [INFO ] [alacritty] PTY dimensions: 30 x 78
[0.148110598s] [INFO ] [alacritty] Initialisation complete
[0.163691072s] [INFO ] [alacritty] Goodbye
Deleted log file at "/tmp/Alacritty-43853.log"

Could you git checkout 6071a7bf (the last working commit), and then apply this patch:

diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index 44a8bc2f..2b33bfa5 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -40,7 +40,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.29.1-beta", default-features = false, features = ["serde"] }
+winit = { git = "https://github.com/kchibisov/winit", rev = "a857d3faacc62e26e49f129263bdc0a0ac2d85c2", default-features = false, features = ["serde"] }

 [build-dependencies]
 gl_generator = "0.14.0"

I’d expect it to fail, and then apply this

diff --git a/alacritty/Cargo.toml b/alacritty/Cargo.toml
index 44a8bc2f..fd6dff3f 100644
--- a/alacritty/Cargo.toml
+++ b/alacritty/Cargo.toml
@@ -40,7 +40,7 @@ serde_json = "1"
 serde_yaml = "0.9.25"
 toml = "0.8.2"
 unicode-width = "0.1"
-winit = { version = "0.29.1-beta", default-features = false, features = ["serde"] }
+winit = { git = "https://github.com/kchibisov/winit", rev = "a444db37fdf839e124a53deb1d886973ab339a21", default-features = false, features = ["serde"] }

 [build-dependencies]
 gl_generator = "0.14.0"

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.

meo@arch ~/alacritty $ time target/release/alacritty -vv -e false
Created log file at "/tmp/Alacritty-1139.log"
[0.000286978s] [INFO ] [alacritty] Welcome to Alacritty
[0.000533099s] [INFO ] [alacritty] Version 0.14.0-dev (ea450f51)
[0.000542178s] [INFO ] [alacritty] Running on X11
[0.003092293s] [INFO ] [alacritty] Configuration files loaded from:
                                     "/home/meo/.config/alacritty/alacritty.toml"
[0.006599373s] [INFO ] [alacritty] Using GLX 1.4
[0.039565927s] [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
Time to build window 2.36044011s
[2.402346837s] [INFO ] [alacritty] Window scale factor: 1.5
[2.403383212s] [DEBUG] [alacritty] Loading "Fira Code" font
[2.435875334s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.453697573s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Bold, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.470567316s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.486570399s] [DEBUG] [crossfont] Loaded Face Face { ft_face: Font Face: Regular, load_flags: TARGET_LIGHT, render_mode: "Lcd", lcd_filter: 1 }
[2.491166305s] [INFO ] [alacritty] Running on AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.54, 6.6.8-arch1-1)
[2.491184953s] [INFO ] [alacritty] OpenGL version 4.6 (Core Profile) Mesa 23.3.1-arch1.1, shader_version 4.60
[2.491192495s] [INFO ] [alacritty] Using OpenGL 3.3 renderer
[2.499266847s] [DEBUG] [alacritty] Enabled debug logging for OpenGL
[2.499362459s] [DEBUG] [alacritty] Filling glyph cache with common glyphs
[2.509304646s] [INFO ] [alacritty] Cell size: 10 x 20
[2.509321338s] [INFO ] [alacritty] Padding: 7 x 0
[2.509327833s] [INFO ] [alacritty] Width: 800, Height: 600
[2.516766279s] [INFO ] [alacritty] PTY dimensions: 30 x 78
[2.520877836s] [INFO ] [alacritty] Initialisation complete
[2.536330080s] [INFO ] [alacritty] Goodbye
Deleted log file at "/tmp/Alacritty-1139.log"

real	0m2.614s
user	0m0.138s
sys	0m0.062s

WezTerm also affected.

meo@arch ~/alacritty $ time wezterm -e false
18:56:42.623  WARN   window::os::x11::connection > Unable to resolve appearance using xdg-desktop-portal: get_appearance.read_setting: Reading xdg-portal org.freedesktop.appearance color-scheme: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

real	0m2.661s
user	0m0.044s
sys	0m0.058s
meo@arch ~/alacritty $ time wezterm -e false
18:56:43.543  WARN   window::os::x11::connection > Unable to resolve appearance using xdg-desktop-portal: get_appearance.read_setting: Reading xdg-portal org.freedesktop.appearance color-scheme: org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

real	0m0.126s
user	0m0.064s
sys	0m0.043s

Here is your requested info:

$ xdpyinfo -queryExtensions | grep opcode
    BIG-REQUESTS  (opcode: 133)
    Composite  (opcode: 142)
    DAMAGE  (opcode: 143, base event: 91, base error: 152)
    DOUBLE-BUFFER  (opcode: 145, base error: 153)
    DPMS  (opcode: 147)
    DRI2  (opcode: 155, base event: 119)
    DRI3  (opcode: 149)
    GLX  (opcode: 152, base event: 95, base error: 158)
    Generic Event Extension  (opcode: 128)
    MIT-SCREEN-SAVER  (opcode: 144, base event: 92)
    MIT-SHM  (opcode: 130, base event: 65, base error: 128)
    Present  (opcode: 148)
    RANDR  (opcode: 140, base event: 89, base error: 147)
    RECORD  (opcode: 146, base error: 154)
    RENDER  (opcode: 139, base error: 142)
    SECURITY  (opcode: 137, base event: 86, base error: 138)
    SHAPE  (opcode: 129, base event: 64)
    SYNC  (opcode: 134, base event: 83, base error: 134)
    X-Resource  (opcode: 150)
    XC-MISC  (opcode: 136)
    XFIXES  (opcode: 138, base event: 87, base error: 140)
    XFree86-DGA  (opcode: 154, base event: 112, base error: 179)
    XFree86-VidModeExtension  (opcode: 153, base error: 172)
    XINERAMA  (opcode: 141)
    XInputExtension  (opcode: 131, base event: 66, base error: 129)
    XKEYBOARD  (opcode: 135, base event: 85, base error: 137)
    XTEST  (opcode: 132)
    XVideo  (opcode: 151, base event: 93, base error: 155)
$ grep ' 8$' /usr/include/xcb/randr.h | grep define
#define XCB_RANDR_GET_SCREEN_RESOURCES 8
$ xrandr --version
xrandr program version       1.5.2
Server reports RandR version 1.6

From the original comment:

...
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>
...

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.

$ xdpyinfo -queryExtensions | grep 'opcode: 140'
    RANDR  (opcode: 140, base event: 89, base error: 147)

Next, minor opcode is \10, so 8. That would then be a GetScreenResources request, which is known to be sometimes slow.

$ grep ' 8$' /usr/include/xcb/randr.h | grep define
#define XCB_RANDR_GET_SCREEN_RESOURCES 8

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?:

$ xrandr --version
xrandr program version       1.5.2
Server reports RandR version 1.6

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) to randr_query_version(1, 3) (or whatever version of randr winit actually “hopes for”).

Edit:

diff --git a/src/platform_impl/linux/x11/monitor.rs b/src/platform_impl/linux/x11/monitor.rs
index 09e42d66..e5859ac3 100644
--- a/src/platform_impl/linux/x11/monitor.rs
+++ b/src/platform_impl/linux/x11/monitor.rs
@@ -344,7 +344,7 @@ impl ScreenResources {
         conn: &impl x11rb::connection::Connection,
         root: &x11rb::protocol::xproto::Screen,
     ) -> Result<Self, X11Error> {
-        let version = conn.randr_query_version(0, 0)?.reply()?;
+        let version = conn.randr_query_version(1, 3)?.reply()?;
 
         if (version.major_version == 1 && version.minor_version >= 3) || version.major_version > 1 {
             let reply = conn

Try 0.12.3 again. This is almost certainly a driver initialization issue.