Skip to content

Very slow parallel performance on large file trees #63

Description

@bgroenks96

I noticed that lazy computations on my FileTree were really, really slow (and always slower than sequential evaluation), so I did a quick test:

using Distributed
addprocs(exeflags=["--sysimage JuliaSysImage.so", "--threads=1", "--project"])
@everywhere using FileTrees, Distributed
tree = FileTree("my/path/here")

where the path is replaced with some file tree (in my case it is a tree consisting of about 3600 files). This shouldn't matter that much for the test, I would think.

I run lazy FileTrees.load with a simple throwaway operation to check the overhead from using parallel processing. Now, I would fully expect parallelization to not pay off here given the simplicity of the operation. What is shocking (and quite frankly intolerable), however, is that the overhead adds several orders of magnitude to wall clock execution time.

julia> @time exec(FileTrees.load(f -> 2+2, tree, lazy=true));
614.403524 seconds (365.52 M allocations: 11.479 GiB, 1.19% gc time, 0.07% compilation time)

julia> @time exec(FileTrees.load(f -> 2+2, tree, lazy=true));
103.727996 seconds (275.26 M allocations: 5.656 GiB, 2.51% gc time, 0.32% compilation time)

julia> @time exec(FileTrees.load(f -> 2+2, tree));
  1.112900 seconds (1.46 M allocations: 94.482 MiB, 3.98% gc time, 53.46% compilation time)

The first attempt took over 10 minutes compared to 1 second for sequential execution. This looks to be precompilation related given the speed-up on the second attempt. However, even then, it is 100x slower than sequential evaluation, which I think far exceeds reasonable overhead even for such a simple operation.

I am running this on a remote machine which is using a networked file system, so I suspect that this may also be part of the problem.

Am I missing anything or doing something stupid here? Is this a known issue?

EDIT: I updated the title to better reflect the suspected issue, per the feedback of @DrChainsaw .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions