Skip to content

glocalfileinfo: Use a single timeout source at a time for hidden file cache

Carlos Garnacho requested to merge wip/carlosg/shared-hidden-cache-timeout into master

As hidden file caches currently works, every look up on a directory caches its .hidden file contents, and sets a 5s timeout to prune the directory from the cache.

This creates a problem for usecases like Tracker Miners, which is in the business of inspecting as many files as possible from as many directories as possible in the shortest time possible. One timeout is created for each directory, which possibly means gobbling thousands of entries in the hidden file cache. This adds as many GSources to the glib worker thread, with the involved CPU overhead in iterating those in its main context.

To fix this, use a unique timeout that will keep running until the cache is empty. This will keep the overhead constant with many files/folders being queried.

Merge request reports