74 |
vs = win.createVobScene() |
vs = win.createVobScene() |
75 |
sx = vs.size.width |
sx = vs.size.width |
76 |
|
|
77 |
|
outfile = open("benchdata","w") |
78 |
|
|
79 |
for ar in _argLists(args): |
for ar in _argLists(args): |
80 |
vs = win.createVobScene() |
vs = win.createVobScene() |
89 |
# print "Now: ",iters,total,ms |
# print "Now: ",iters,total,ms |
90 |
print ou |
print ou |
91 |
print ms, "ms with ",iters," in ",total |
print ms, "ms with ",iters," in ",total |
92 |
|
outfile.write("%s %s\n" % (ou, ms)) |
93 |
print 1000.0 / ms,"per second\n" |
print 1000.0 / ms,"per second\n" |
94 |
|
|
95 |
|
outfile.close() |
96 |
|
|
97 |
def runPureBench(func, args): |
def runPureBench(func, args): |
98 |
for ar in _argLists(args): |
for ar in _argLists(args): |
99 |
# Precompile for JIT |
# Precompile for JIT |
103 |
|
|
104 |
total = 0 |
total = 0 |
105 |
iters = 1 |
iters = 1 |
106 |
while total < 2.0: |
while total < 3.0: |
107 |
iters *= 2 |
iters *= 2 |
108 |
(total, str) = func(iters, **ar) |
(total, str) = func(iters, **ar) |
109 |
ms = total * 1. / iters * 1000 |
ms = total * 1. / iters * 1000 |