Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【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