当前位置: 首页>>代码示例>>Python>>正文


Python Benchmark.title方法代码示例

本文整理汇总了Python中benchmark.Benchmark.title方法的典型用法代码示例。如果您正苦于以下问题:Python Benchmark.title方法的具体用法?Python Benchmark.title怎么用?Python Benchmark.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在benchmark.Benchmark的用法示例。


在下文中一共展示了Benchmark.title方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Benchmark

# 需要导入模块: from benchmark import Benchmark [as 别名]
# 或者: from benchmark.Benchmark import title [as 别名]
from benchmark import Benchmark

modules = ['numpy','Numeric','numarray']
b = Benchmark(modules,runs=3,reps=100)

N = 10000
b.title = 'Sorting %d elements' % N
b['numarray'] = ('a=np.array(None,shape=%d,typecode="i");a.sort()'%N,'')
b['numpy'] = ('a=np.empty(shape=%d, dtype="i");a.sort()'%N,'')
b['Numeric'] = ('a=np.empty(shape=%d, typecode="i");np.sort(a)'%N,'')
b.run()

N1,N2 = 100,100
b.title = 'Sorting (%d,%d) elements, last axis' % (N1,N2)
b['numarray'] = ('a=np.array(None,shape=(%d,%d),typecode="i");a.sort()'%(N1,N2),'')
b['numpy'] = ('a=np.empty(shape=(%d,%d), dtype="i");a.sort()'%(N1,N2),'')
b['Numeric'] = ('a=np.empty(shape=(%d,%d),typecode="i");np.sort(a)'%(N1,N2),'')
b.run()

N1,N2 = 100,100
b.title = 'Sorting (%d,%d) elements, first axis' % (N1,N2)
b['numarray'] = ('a=np.array(None,shape=(%d,%d), typecode="i");a.sort(0)'%(N1,N2),'')
b['numpy'] = ('a=np.empty(shape=(%d,%d),dtype="i");np.sort(a,0)'%(N1,N2),'')
b['Numeric'] = ('a=np.empty(shape=(%d,%d),typecode="i");np.sort(a,0)'%(N1,N2),'')
b.run()
开发者ID:123jefferson,项目名称:MiniBloq-Sparki,代码行数:27,代码来源:sorting.py

示例2: Benchmark

# 需要导入模块: from benchmark import Benchmark [as 别名]
# 或者: from benchmark.Benchmark import title [as 别名]
from benchmark import Benchmark

modules = ["numpy", "Numeric", "numarray"]
b = Benchmark(modules, runs=3, reps=100)

N = 10000
b.title = "Sorting %d elements" % N
b["numarray"] = ('a=np.array(None,shape=%d,typecode="i");a.sort()' % N, "")
b["numpy"] = ('a=np.empty(shape=%d, dtype="i");a.sort()' % N, "")
b["Numeric"] = ('a=np.empty(shape=%d, typecode="i");np.sort(a)' % N, "")
b.run()

N1, N2 = 100, 100
b.title = "Sorting (%d,%d) elements, last axis" % (N1, N2)
b["numarray"] = ('a=np.array(None,shape=(%d,%d),typecode="i");a.sort()' % (N1, N2), "")
b["numpy"] = ('a=np.empty(shape=(%d,%d), dtype="i");a.sort()' % (N1, N2), "")
b["Numeric"] = ('a=np.empty(shape=(%d,%d),typecode="i");np.sort(a)' % (N1, N2), "")
b.run()

N1, N2 = 100, 100
b.title = "Sorting (%d,%d) elements, first axis" % (N1, N2)
b["numarray"] = ('a=np.array(None,shape=(%d,%d), typecode="i");a.sort(0)' % (N1, N2), "")
b["numpy"] = ('a=np.empty(shape=(%d,%d),dtype="i");np.sort(a,0)' % (N1, N2), "")
b["Numeric"] = ('a=np.empty(shape=(%d,%d),typecode="i");np.sort(a,0)' % (N1, N2), "")
b.run()
开发者ID:beiko-lab,项目名称:gengis,代码行数:27,代码来源:sorting.py


注:本文中的benchmark.Benchmark.title方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。