busbud/coding-challenge-d — pull request #3 by mlhamel (2014-09-12 12:49:03+00:00)
Title: Processing images in parallel using multiprocessing

Since we want to use multiple cores of the cpu, we've decided not used normal thread but the multiprocessing library and to base our solution the Process class.

For that, we are launching one process per image and this process is doing 4 things:

1. Load and scale the image
2. Launch a new process to blur and crop on top an image
3. Launch a new process to blur and crop on bottom an image
4. Blur and crop from the middle

We've decided to keep the 4th operation in the original process cause if not we would waste time at creating a new process when the original one was just waiting and be useless.

We've took the opportunity to re-arrange a bit code, fixing the utf8 marker, creating a real setuptools based package and using entry points to create a console script which was useful for testing.

Everything was timed and ran like that:

$ time challenge-run
real	0m6.085s
user	0m22.299s
sys	0m0.405s