perf(sni): eliminate icon theme rescanning from system tray hotpath
Valgrind Massif profiling revealed that invoking Gtk::IconTheme::rescan_if_needed() inside SNI updateImage() and getIconByName() loops caused considerable memory churn and potential filesystem stat overhead whenever a system tray app pushed a metadata update. This commit removes the rescan polling from the SNI proxy callback pipeline and the DefaultGtkIconThemeWrapper, restricting icon theme caching to load boundaries. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -423,8 +423,6 @@ Glib::RefPtr<Gdk::Pixbuf> Item::getIconPixbuf() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Pixbuf> Item::getIconByName(const std::string& name, int request_size) {
|
Glib::RefPtr<Gdk::Pixbuf> Item::getIconByName(const std::string& name, int request_size) {
|
||||||
icon_theme->rescan_if_needed();
|
|
||||||
|
|
||||||
if (!icon_theme_path.empty()) {
|
if (!icon_theme_path.empty()) {
|
||||||
auto icon_info = icon_theme->lookup_icon(name.c_str(), request_size,
|
auto icon_info = icon_theme->lookup_icon(name.c_str(), request_size,
|
||||||
Gtk::IconLookupFlags::ICON_LOOKUP_FORCE_SIZE);
|
Gtk::IconLookupFlags::ICON_LOOKUP_FORCE_SIZE);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ Glib::RefPtr<Gdk::Pixbuf> DefaultGtkIconThemeWrapper::load_icon(
|
|||||||
const std::lock_guard<std::mutex> lock(default_theme_mutex);
|
const std::lock_guard<std::mutex> lock(default_theme_mutex);
|
||||||
|
|
||||||
auto default_theme = Gtk::IconTheme::get_default();
|
auto default_theme = Gtk::IconTheme::get_default();
|
||||||
default_theme->rescan_if_needed();
|
|
||||||
|
|
||||||
auto icon_info = default_theme->lookup_icon(name, tmp_size, flags);
|
auto icon_info = default_theme->lookup_icon(name, tmp_size, flags);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user