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

pfork performance tips? #4

Open
timholy opened this issue Oct 15, 2013 · 1 comment
Open

pfork performance tips? #4

timholy opened this issue Oct 15, 2013 · 1 comment

Comments

@timholy
Copy link
Contributor

timholy commented Oct 15, 2013

Hi Amit,

I'm finally getting around to trying the approach in your gist---many thanks for that example, it makes it very easy to use.

Currently I'm getting the result that for small-ish datasets (all I have room for on my laptop), using pfork with 4 workers is slower than just doing it the regular way. I tried profiling, but the profiler doesn't seem to work with pfork, unfortunately. Given the cautions about I/O, I'm a little unsure of the best approach for figuring out where the time is going---is it the fork itself, or some other aspect?

The overall task is one where I take a single 3D array as input, and each worker should work on a separate chunk of a 2D output (this is a 3D image-rendering problem). I'm allocating each output chunk with your anon_map, and just using a plain array (optionally, mmapped to a file) as an input. The running time for a small data set in single-threaded mode is 0.2 s, whereas a pfork with 4 workers is approximately 4 times slower.

@timholy
Copy link
Contributor Author

timholy commented Oct 16, 2013

I'll continue this on the mailing list.

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

1 participant