Skip to content
  • Carlos Garnacho's avatar
    glocalfileinfo: Use a single timeout source at a time for hidden file cache · 92c19ebd
    Carlos Garnacho authored and Philip Withnall's avatar Philip Withnall committed
    As hidden file caches currently work, 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.
    92c19ebd