Skip to content

Instantly share code, notes, and snippets.

View ryaninhust's full-sized avatar

Bowen Yuan ryaninhust

  • NYC
  • 19:26 (UTC -04:00)
View GitHub Profile
在macbook pro 4核上的测试结果,python自带的map表现比起ipython 的map,list comprehensions都要好。但是有优化的multi_mcpi还是不错。
$ ipcluster start --n=4
print mcpi(100000000)
#print multi_mcpi_by_map(dview, 100000000) # 传递太耗时
#print multi_mcpi_by_list_comp(dview, 100000000)
#print multi_mcpi(dview, 100000000)
$ time py multi_mcpi.py
importing random from random on engine(s)