Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index_files(path::S3Path) is very slow on large directories #35

Open
aisopous opened this issue Sep 27, 2021 · 1 comment
Open

index_files(path::S3Path) is very slow on large directories #35

aisopous opened this issue Sep 27, 2021 · 1 comment

Comments

@aisopous
Copy link
Contributor

aisopous commented Sep 27, 2021

It is because isfile being run on each path returned by collect(walkpath) on this line.

One possible workaround would be to filter out paths which end in /. For a 3000 file path the difference is 0.8s vs 60s using isfile.

@nickrobinson251
Copy link
Contributor

i wonder if we can trust the isdirectory::Bool field to tell us when an S3Path is not pointing to a file?
then we could maybe have something like

function index_files(dir::S3Path)
    isdir(dir) || throw(ArgumentError(dir, "Need an existing directory."))
    map(Iterators.filter(p -> !p.isdirectory, walkpath(dir))) do path
        return IndexEntry(path)
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants