Skip to content

Speed up app startup (defer sticker reads via InvokeQueued)#30308

Open
futpib wants to merge 1 commit intotelegramdesktop:devfrom
futpib:defer-sticker-reads
Open

Speed up app startup (defer sticker reads via InvokeQueued)#30308
futpib wants to merge 1 commit intotelegramdesktop:devfrom
futpib:defer-sticker-reads

Conversation

@futpib
Copy link
Contributor

@futpib futpib commented Feb 18, 2026

Instead of reading all sticker sets synchronously in crl::on_main, chain each read step via InvokeQueued so that paint events can be processed between heavy file reads. This moves first paint from ~2807ms to ~1294ms in my tests by allowing the UI to render before sticker loading completes.
I checked it locally with a bunch of PROFILE_LOGs: https://github.com/telegramdesktop/tdesktop/compare/dev...futpib:faster-startup?expand=1
I also considered making this InvokeQueued queue an util in lib_base, tell me if you prefer that.

Instead of reading all sticker sets synchronously in crl::on_main,
chain each read step via InvokeQueued so that paint events can be
processed between heavy file reads. This moves first paint from
~2807ms to ~1294ms by allowing the UI to render before sticker
loading completes.
@futpib futpib force-pushed the defer-sticker-reads branch from b05d438 to 7d04ce3 Compare February 28, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant