directory-async: Use hash tables for ready callbacks
This improves performance with directories that have a large number
of direct descendants. Also use the words 'unsatisfied' and 'ready'
instead of active and inactive to better describe the two types.
Simplify ordered comparision function into equality since it's not
being used as ordered comparsion. Keep the name to imply that
it still treats 0 as an equal, same as GCompareFunc.
file: Reuse parent for thumbnail preference calculation
Most of the time, the functions end up looking up the parent file
twice. So reuse the parent file by passing it directly to improve
performance when loading many files. This roughly improves
`get_speed_tradeoff_preference_for_file` by about 40% when having
local thumbnails only preference, which is by itself about 10%
of CPU time of loading large directories before this optimization.
There's no reason for this to be restricted to directories. it was
introduced in [1] which seems to just copy the logic from [2] which
was meant for `filesystem::type`. I can't find any commit or
documentation change that states it was ever exclusive to
directories though. Also protect the reading with a check to wether
the filesystem metadata is up to date.
properties-window: Limit the number of names added.
Put an upper limit on the number of names added to the properties
window. This improves performance when selecting large number
files. Moreover, it is unlikely for many items to fit in the
allocated text area.
properties-window: Reuse GFiles and store them in a hashtable
When displaying the properties of a large number of files that are
not nested, an inefficient code cause the dialog to take 100+
seconds to open. Instead of generating the entire list again for
every check, store them in hash table before iterating, and search
using the hash table. This provides extreme time saving factor
with large file count.
f1c683d...
by
=?utf-8?q?Ant=C3=B3nio_Fernandes?= <email address hidden>
files-view: Update actions immediately on selection change
In the network view, if the row is not selected, clicking the unmount
button does nothing. Indeed, the action is still disabled, despite an
elligible item being selected already.
This happens because the because actions state is updated on idle
along with the context menus. This is reasonable as the context menus
update can be expensive.
However, not updating actions state imimediately is unexpected, so
let's immediately update them when selection changes.