The command palette rebuilds all <img> tags on every keystroke, each pointing to google.com/s2/favicons?domain=.... The browser caches these so it's not making network requests each time, but it's still creating N new DOM elements per keystroke.
Options:
- Pre-fetch and cache favicon URLs at startup into a
Map
- Debounce the palette re-render (also helps general performance)
- Use CSS background images instead of
<img> tags so the DOM churn is lower
The command palette rebuilds all
<img>tags on every keystroke, each pointing togoogle.com/s2/favicons?domain=.... The browser caches these so it's not making network requests each time, but it's still creating N new DOM elements per keystroke.Options:
Map<img>tags so the DOM churn is lower