Skip to content

Do not check for directory when looking for cache files #2877

@skshetry

Description

@skshetry

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhances DVCp2-mediumMedium priority, should be done, but less importantperformanceimprovement over resource / time consuming tasksrefactoringFactoring and re-factoring

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions