Skip to content

wallpapers/image: Fix high cpu usage when wallpaper dialog is open

  • wallpapers/image: Fix high cpu usage when wallpaper dialog is open

The title and the author records are cached. But cache is not the right abstraction for storing such information because more than 10 wallpapers can be shown at the same time, which can trigger a feedback loop: query metadata for an image => evacuate some metadata from a cache to make space for the just loaded metadata => query metadata for an image whose metadata has been just released (for example if the view side wants it again) and so on.

This change makes the wallpaper model store background metadata in hash tables in order to address high CPU usage.

CCBUG: 511265

Edited by Vlad Zahorodnii

Merge request reports

Loading