Recent refactoring in #2873 and #2853 implemented isdir(), isfile() and exists(). exists() checks if the given path exists using isdir as well as isfile. isfile simply checks for existence of the blob (in case of s3 and gs), whereas isdir checks if any files with the prefix exists.
.cache_exists() uses .exists(), but does not care about directory paths. So, to reduce number of ._list_paths() remote calls, it's better to refactor .cache_exists() to use isfile.
As @Suor notes here #2873 (comment), isfile might not have been implemented in all remotes, or might be slower in some remotes.
Further infomation: #2873 (comment)
Recent refactoring in #2873 and #2853 implemented
isdir(),isfile()andexists().exists()checks if the given path exists usingisdiras well asisfile.isfilesimply checks for existence of the blob (in case of s3 and gs), whereasisdirchecks if any files with the prefix exists..cache_exists()uses.exists(), but does not care about directory paths. So, to reduce number of._list_paths()remote calls, it's better to refactor.cache_exists()to useisfile.As @Suor notes here #2873 (comment),
isfilemight not have been implemented in all remotes, or might be slower in some remotes.Further infomation: #2873 (comment)