diff options
author | lukefromdc <[email protected]> | 2018-10-03 00:55:11 -0400 |
---|---|---|
committer | lukefromdc <[email protected]> | 2018-10-03 01:11:02 -0400 |
commit | 6c423bc27d2803f3259bcca9f518a1c22b2b5fd1 (patch) | |
tree | a526c253d7cd39c38a64d5acb48638e07d1351cc /src/caja-file-management-properties.h | |
parent | 021ff2ac062f1cfd52726c78e9a3956405001c6e (diff) | |
download | caja-6c423bc27d2803f3259bcca9f518a1c22b2b5fd1.tar.bz2 caja-6c423bc27d2803f3259bcca9f518a1c22b2b5fd1.tar.xz |
Caja-icon-info: Optimize icon lookups by GIcon.
The caja_icon_info_lookup method was potentially doing multiple
icon lookups for a single icon, as well as triggering an additional
fallback lookup when returning an empty (no pixbuf) CajaIconInfo
to CajaFile.
This streamlines and simplifies the lookup process. The hash table
lookup always occurs first, before any Gtk icon cache lookup is made
(these are expensive, according to perf analysis,) and a returned
icon info will *always* be added to a hash table, potentially already
containing a fallback icon.
GIcons stringify well enough to use the strings exclusively for hash
keys. This eliminates the extra cost of looking up filenames from the
Gtk icon cache.
Ported from
github.com/linuxmint/nemo/commit/98843e26b48cd3526cacfe90cfa4ba201d1f3aee
where this benchmark resulted for Nemo:
.# sync; echo 3 > /proc/sys/vm/drop_caches
mtwebster:~/bin/nemo[master]> NEMO_BENCHMARK_LOADING=1 nemo /usr/bin
with:
Nemo startup time: 2.011817 seconds
Folder load time: 1.158854 seconds
Idle...Folder load time: 1.226699 seconds
without:
Nemo startup time: 2.464361 seconds
Folder load time: 1.591494 seconds
Idle...Folder load time: 1.692273 seconds
Diffstat (limited to 'src/caja-file-management-properties.h')
0 files changed, 0 insertions, 0 deletions