Skip to content

Speed up app startup (remove redundant cache and pre-warming)#30310

Closed
futpib wants to merge 1 commit intotelegramdesktop:devfrom
futpib:remove-webview-caching
Closed

Speed up app startup (remove redundant cache and pre-warming)#30310
futpib wants to merge 1 commit intotelegramdesktop:devfrom
futpib:remove-webview-caching

Conversation

@futpib
Copy link
Contributor

@futpib futpib commented Feb 18, 2026

Iv::ShowButton() and LocationPicker::Available() each cache the result of Webview::Availability() in a static local.
These caches will be redundant if/when desktop-app/lib_webview#136 is merged.

TLDR: look at desktop-app/lib_webview#136 first

A better idea: desktop-app/lib_webview#136 (comment)

Iv::ShowButton() and LocationPicker::Available() each cache the
result of Webview::Availability() in a static local. These caches
are redundant since desktop-app/lib_webview#136 adds internal
caching to Availability() itself.

Remove the per-caller static caches and the pre-warming calls in
Application::run() that existed only to populate them early.
// Create mime database, so it won't be slow later.
QMimeDatabase().mimeTypeForName(u"text/plain"_q);

// Check now to avoid re-entrance later.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're returning re-entrance. That's critical, the app is going to crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants