Skip to content

perf(browser): move favicon probe off the page-load critical path#414

Merged
nicoburns merged 2 commits intoDioxusLabs:mainfrom
tonybierman:browser-history-fix-slow
May 3, 2026
Merged

perf(browser): move favicon probe off the page-load critical path#414
nicoburns merged 2 commits intoDioxusLabs:mainfrom
tonybierman:browser-history-fix-slow

Conversation

@tonybierman
Copy link
Copy Markdown
Contributor

Page navigations were blocking on a favicon fetch plus a full image decode before swapping in the new document, adding a round-trip of latency to every load. This moves the probe into a background task spawned after the document is applied, with stale-probe guards on the tab and id-keyed patching of history entries so a late-arriving icon still updates the right row.

tonybierman and others added 2 commits May 2, 2026 20:43
The favicon resolver was awaited inside DocumentLoader::load_document,
so every navigation blocked on a network round-trip plus a full image
decode of the icon before the new document could be swapped in. The
decode also ran on the async executor thread.

Split favicon resolution into a synchronous candidate-URL computation
and an async probe. The loader returns immediately with the candidate;
the tab spawns the probe in the background and writes tab.favicon_url
when it resolves (gated on the tab still being on the same page, so a
stale probe can't stomp a newer navigation). History entries created
with favicon=None get patched in place via a new BrowsingHistory::
set_favicon(id, url), keyed by the entry id record_visit now returns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tonybierman
Copy link
Copy Markdown
Contributor Author

tonybierman commented May 3, 2026

@nicoburns see details in commit. The performance hit was sluggish enough to merit a quick PR to fix it IMHO.

@nicoburns nicoburns merged commit c309f80 into DioxusLabs:main May 3, 2026
15 checks passed
@nicoburns
Copy link
Copy Markdown
Member

Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants