/usr/lib/python2.7/dist-packages/mx/Tools/mxTools/bench2.py is in python-egenix-mxtools 3.2.7-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import hack
import mx.Tools.NewBuiltins
a = trange(10000)
def f1():
x = (a,a,a)
for i in trange(100):
x = lists(x)
def f2():
x = (a,a,a)
for i in trange(100):
x = tuples(x)
def f3(apply=apply,map=map,tuple=tuple):
x = (a,a,a)
y = None
for i in trange(100):
x = apply(map,(y,)+tuple(x))
print 'lists:',hack.clock('f1()')
print 'tuples:',hack.clock('f2()')
print 'map:',hack.clock('f3()')
|