Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active May 28, 2016 04:25
Show Gist options
  • Save kurozumi/ad0b18004256e01a45cac6f3a85decc1 to your computer and use it in GitHub Desktop.
Save kurozumi/ad0b18004256e01a45cac6f3a85decc1 to your computer and use it in GitHub Desktop.
【Python】Benchmarker.pyを使ってマルチプロセスの速度をチェックする方法
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