Last active
May 28, 2016 04:25
-
-
Save kurozumi/ad0b18004256e01a45cac6f3a85decc1 to your computer and use it in GitHub Desktop.
【Python】Benchmarker.pyを使ってマルチプロセスの速度をチェックする方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from benchmarker import Benchmarker | |
from multiprocessing import Pool | |
def f(x): | |
x**2 | |
with Benchmarker(10000, width=20) as bench: | |
@bench("mp") | |
def _(bm): | |
Pool(10).map(f, bm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment