{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Speed up by parallel processing\n", "\n", "* This [blogpost on processes and threads](https://medium.com/@bfortuner/python-multithreading-vs-multiprocessing-73072ce5600b) gives a good introduction and has a nice notebook with some simple experiments that you can run on your own machine.\n", " * **Your turn** In [the notebook connected to the post](https://github.com/bfortuner/ml-study/blob/master/multitasking_python.ipynb) experiments are done with 1,2 and 4 threads and processes. Now write a function which executes an experiment with i processes or threads for i in range(1,N) and which outputs for each i the runtime. Plot these runtimes and see when adding threads or processes actually starts to slow things down (on your computer). \n", " * Run this for the various tasks mentioned in the blogpost and possibly for a task you added yourself and plot all the runtimes of the different tasks together in one graph (each task a separate line). Pandas plotting seems well suited for this.\n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.12" } }, "nbformat": 4, "nbformat_minor": 2 }