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

Q: Does num_workers process the file in parallel? #74

Closed
cdesch opened this issue Nov 9, 2017 · 3 comments
Closed

Q: Does num_workers process the file in parallel? #74

cdesch opened this issue Nov 9, 2017 · 3 comments
Labels

Comments

@cdesch
Copy link

cdesch commented Nov 9, 2017

Just as the title says, if I want to process a file with the rows processing independently of each other (non-sequential), does setting the num_workers to, let's say 6, process the file in 6 independent processes?


iex> "../test/fixtures/docs/valid.csv"
iex> |> Path.expand(__DIR__)
iex> |> File.stream!
iex> |> CSV.decode(num_workers: 6)
@beatrichartz
Copy link
Owner

It splits the stream into 6 parallel processes. The File.stream! itself is not parallelised, but is rarely the bottleneck.

@cdesch
Copy link
Author

cdesch commented Dec 20, 2017

So that is only allocating 6 processes to handle the work of that one File.stream!?

Would I need to run 6 separate tasks of File.stream! on 6 different files with CSV.decode(num_workers: 6) to get 36 processes?

@beatrichartz
Copy link
Owner

I will close this for now as the File Stream should not be the bottleneck in this. If there is a performance or backpressure issue that you're seeing in your setup please feel free to reopen.

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

No branches or pull requests

2 participants