sort by min time in the image speed encoding test

This commit is contained in:
Dane Springmeyer 2012-11-08 16:42:18 -05:00
parent d0f0f9690f
commit f8318c81be

View file

@ -62,7 +62,7 @@ def do_encoding():
min_ = min(set)*1000 min_ = min(set)*1000
avg = (sum(set)/len(set))*1000 avg = (sum(set)/len(set))*1000
name = func.__name__ + ' ' + format name = func.__name__ + ' ' + format
results[name] = [avg,min_,elapsed*1000,name,len(func())] results[name] = [min_,avg,elapsed*1000,name,len(func())]
sortable[name] = [min_] sortable[name] = [min_]
def blank(): def blank():
@ -101,13 +101,13 @@ def do_encoding():
for key, value in sorted(sortable.iteritems(), key=lambda (k,v): (v,k)): for key, value in sorted(sortable.iteritems(), key=lambda (k,v): (v,k)):
s = results[key] s = results[key]
avg = str(s[0])[:6] min_ = str(s[0])[:6]
min_ = str(s[1])[:6] avg = str(s[1])[:6]
elapsed = str(s[2])[:6] elapsed = str(s[2])[:6]
percent_reduction = s[4] percent_reduction = s[4]
name = s[3] name = s[3]
size = s[4] size = s[4]
print 'avg: %sms | min: %sms | total: %sms | len: %s <-- %s' % (min_,avg,elapsed,size,name) print 'min: %sms | avg: %sms | total: %sms | len: %s <-- %s' % (min_,avg,elapsed,size,name)
if __name__ == "__main__": if __name__ == "__main__":