Skip to content

HashMap in ThunarFolder to improve performance

using a hashmap to improve performance in ThunarFolder. Previously the entire GList of folder files had to be iterated over to check if a newly queried file is already in the existing list. So it improve upon this a new HashTable has been created that store mappings of (gfile, GList *node). The GFile's are keys while the GList node is the value. This makes lookups O(1) thus vastly improving performance for for i in {1..10000}; do touch $i; done or rm -rf *.

Use case that this MR improves upon

when for i {1..10000}; do touch $i; done or rm -rf * run from a terminal on a particular folder and that same folder is open on Thunar, Thunar freezes(unresponsive) for quite a bit of time.

Note: But unfortunately Thunar still freezes when for i in {1..10000}; do rm $i; done is run from a terminal.

Additional this MR also reverts the folder files-added & files-removed batching feature due to the issue of #1149 (closed) . But it is being worked on !372 (closed) .

Edited by Amrit Kashyap Borah

Merge request reports

Loading