前回は Python の標準ライブラリに用意されているプロファイラの profile/cProfile モジュールについて書いた。 blog.amedama.jp 今回は、同じ決定論的プロファイリングを採用したプロファイラの中でも、サードパーティ製の line_profiler を使ってみることにする。 line_profiler は profile/cProfile モジュールに比べるとコード単位でプロファイリングが取れるところが魅力的なパッケージ。 また、インターフェースについても profile/cProfile に近いものとなっている。 今回使った環境は次の通り。 $ sw_vers ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G31 $ python --version Python 3.5.2 イン
![Python: line_profiler でボトルネックを調べる - CUBE SUGAR CONTAINER](https://cdn-ak-scissors.b.st-hatena.com/image/square/009f08c36f65186329ae74a675f1a827d12fde1e/height=288;version=1;width=512/http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F415QwBMiAcL.jpg)