Optimizing this method (HashSet.RemoveWhere performance issue)
Instead of using the RemoveWhere() method together with the Any() method you should consider to just use ExceptWith() method.   

public static HashSet&lt;PathDetails&gt; GetDeletedPaths(HashSet&lt;PathDetails&gt; old, HashSet&lt;PathDetails&gt; current)
{
    var deleted = new HashSet&lt;PathDetails&gt;(old);
    deleted.ExceptWith(current);
    return deleted;
}


Your approach calls for each item in deleted the Any() of current whereas ExceptWith() just calls for each item in current the Remove() method of deleted.