{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# iPython Profiler\n", "\n", "IPython provides access to a wide range of functions to measure times and create profiles. The following magic IPython commands are explained here:\n", "\n", "| Command | Description |\n", "| -------------- | --------------------------------------------------------------------------------- |\n", "| `%time` | Time to execute a single statement |\n", "| `%timeit` | Average time it took to execute a single statement repeatedly |\n", "| `%prun` | Run code with the profiler |\n", "| `%lprun` | Run code with the line-by-line profiler |\n", "| `%memit` | Measure the memory usage of a single statement |\n", "| `%mprun` | Executes the code with the line-by-line memory profiler |\n", "\n", "The last four commands are not contained in IPython itself, but in the modules [line_profiler](https://github.com/pyutils/line_profiler) and [memory_profiler](https://github.com/pythonprofilers/memory_profiler).\n", "\n", "